June 2003
Intermediate to advanced
800 pages
34h 20m
English
You need to reverse the order of letters in a string.
Convert the string to an array of characters and use the Array.Reverse method, or use the legacy StrReverse Visual Basic 6 function.
The functionality for reversing a string isn’t built into the String class, although it’s available in the Array class. Thus, one basic strategy for string reversal is to convert the string into an array of Char objects using the String.ToCharArray method. Then, you can reverse the array using the Array.Reverse shared method. Finally, you can create a new string using a special constructor that accepts a character array.
Dim Text As String = "The quick brown fox jumps over the lazy dog." Dim Chars() As Char = Text.ToCharArray() ...
Read now
Unlock full access