Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var s = "Strings are immutable";
- int length = s.Length;
- unsafe
- {
- fixed (char* c = s)
- {
- for (int i = 0; i < length / 2; i++)
- {
- var temp = c[i];
- c[i] = c[length - i - 1];
- c[length - i - 1] = temp;
- }
- }
- }
- Console.WriteLine("Strings are immutable");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement