Ultime notizie

VB.NET

VB.NET : Come Invertire una stringa

[sourcecode language=”vb”] Module RevString Sub Main() Dim inputString As String = Console.ReadLine() ReverseOrder(inputString) End Sub Private Sub ReverseOrder(ByVal textInput As String) Dim text2Rev As String = textInput Dim reversed As String Dim charArray() As Char = textInput.ToCharArray() Array.Reverse(charArray) reversed = charArray Console.WriteLine("") Console.WriteLine("Testo originale: " + text2Rev) Console.WriteLine("Testo invertito: " + reversed) End Sub End Module [/sourcecode]

Continua a leggere »