String Reverse in VB.NET using LINQ
String reverse using LINQ in VB.NET
Reversing a string :String class has reverse method,
this Reverse method returns IEnumerable<char> so you need to convert it to an array of character.
this Reverse method returns IEnumerable<char> so you need to convert it to an array of character.
String constructor accepts array of characters as input param.
Dim str As String = "Hello World!"
Console.WriteLine(str)
str = New String(str.Reverse().ToArray())
Console.WriteLine(str)
Return str
End Function
Output: !dlroW olleH
Tags:String Reverse in VB.NET using
LINQ, String.Reverse(),convert characters to an array,convert an array
of characters to String,String reverse using LINQ,Reverse.ToArray()
No comments:
Post a Comment