Challenge
Using the C# language, have the function
FirstReverse(str) take the
str parameter being passed and return the string in reversed order. For example: if the input string is "Hello World and Coders" then your program should return the string
sredoC dna dlroW olleH.
Sample Test Cases
Input:"coderbyte"
Output:"etybredoc"
Input:"I Love Code"
Output:"edoC evoL I"
First Reverse算法是倒序输入的字符串.
public static string FirstReverse(string str)
{
List<char> chlist = new List<char>();
int count = str.Length;
for (int i = count - 1; i >= 0; i--)
{
chlist.Add(str[i]);
}
return new string(chlist.ToArray());
}