VB.Net/Development/StringInfo — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:40, 26 мая 2010
Localization StringInfo
Imports System.Globalization
Module Module1
Sub Main()
Dim MyStr, OutBuf As String
Dim Iter As TextElementEnumerator
MyStr = "this is a test"
Iter = StringInfo.GetTextElementEnumerator(MyStr)
Do While (Iter.MoveNext)
OutBuf = "Character at position " + Iter.ElementIndex.ToString() + " = " + Iter.Current
Console.WriteLine(OutBuf)
Loop
Dim k As Int16
For k = 0 To Len(MyStr) - 1
OutBuf = "Character at position " + k.ToString + " = " + StringInfo.GetNextTextElement(MyStr, k)
Console.WriteLine(OutBuf)
Next
Dim j As Int16
For j = 1 To Len(MyStr)
OutBuf = "Character at position " + j.ToString + " = " + Mid(MyStr, j, 1)
Console.WriteLine(OutBuf)
Next
End Sub
End Module