I'm trying to reverse and return a StringBuilder result but I get the following errors for trying all variations in order of return sb.Reverse().ToString()
:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'string'.
'StringBuilder' does not contain a definition for 'Reverse' and no extension method 'Reverse' accepting a first argument of type 'StringBuilder' could be found
What is the proper format for returning the stringbuilder result in reverse order?
public static string Reverse( string s )
{
char[] charArray = s.ToCharArray();
Array.Reverse( charArray );
return new string( charArray );
}
This bit of code unfortunately doesn't do it one line
Please vote to delete this post so I can get rep back XD