作者:VB.NET开发
项目:Syste
Dim title As String = "A Tale of Two Cities"
Dim chEnum As CharEnumerator = title.GetEnumerator()
Dim ctr As Integer = 1
Dim outputLine1, outputLine2, outputLine3 As String
Do While chEnum.MoveNext()
outputLine1 += CStr(iif(ctr < 10 Or ctr Mod 10 <> 0, " ", CStr(ctr \ 10) + " "))
outputLine2 += (ctr Mod 10)& " "
outputLine3 += chEnum.Current & " "
ctr += 1
Loop
Console.WriteLine("The length of the string is {0} characters:", _
title.Length)
Console.WriteLine(outputLine1)
Console.WriteLine(outputLine2)
Console.WriteLine(outputLine3)
作者:VB.NET开发
项目:Syste
Dim title As String = "A Tale of Two Cities"
Dim ctr As Integer = 1
Dim outputLine1, outputLine2, outputLine3 As String
For Each ch As Char In title
outputLine1 += CStr(iif(ctr < 10 Or ctr Mod 10 <> 0, " ", CStr(ctr \ 10) + " "))
outputLine2 += (ctr Mod 10)& " "
outputLine3 += ch & " "
ctr += 1
Next
Console.WriteLine("The length of the string is {0} characters:", _
title.Length)
Console.WriteLine(outputLine1)
Console.WriteLine(outputLine2)
Console.WriteLine(outputLine3)