I have come across a problem upon viewing some tutorials on C# since I just started learning this language recently. I had a problem where once I had reversed a string I had to make use of new string in order to store its actual value in a different varible.
Why is the use of 'new string()' needed? In different programming languages I have never come across the need of using 'new string()'. Thanks in advance :)
//C#
char[] reversedName = name.ToCharArray();
Array.Reverse(reversedName);
string result = new string(reversedName);