c# reverse a string
public static string ReverseString(string s)
{
char[] arr = s.ToCharArray();
Array.Reverse(arr);
return new string(arr);
}public static void Main(string[] args)
{
string s = "aeiouXYZ";
Console.Write(Reverse(s) );
}
public static string Reverse(string s)
{
var result = new string(s.ToCharArray().Reverse().ToArray() );
return result;
}public void ReverseString(char[] s) {
for(int i = 0; i < s.Length / 2; i++) {
char temp = s[i];
s[i] = s[s.Length - 1 - i];
s[s.Length - 1 - i] = temp;
}
}
Also in C#:
- sum the digits in c#
- c# display float with 2 decimal places
- disable mouse unity
- debug.log
- getcomponent c#
- unity set position
- http post request login example asp.net c#
- stop unity editor playing
- c# list string return concatenate
- create dropdown in datatable c# dynamically
- why is c# say ; expected
- c# string array to string
- go right unity
- Linq - Random Elements
- c# param exception
- visual studio C# hintergrund bild ändern
- unity load next scene
- c# round number up
- 2d object look at object
- c# add object to array
- c# list to string comma separated
- c# remove character from string at index
- unity vector3 to array
- c# else if