/****************************************************************************
Challenge
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"
*****************************************************************************/
using System;
public class MainClass {
public static string FirstReverse(string str) {
// code goes here
/* Note: In C# the return type of a function and the
parameter types being passed are defined, so this return
call must match the return type of the function.
You are free to modify the return type. */
//var x = str.Split('');
//return x.Length.ToString();
string y="";
for (int i = str.Length-1;i >=0; i--){
y += str[i].ToString();
}
//return str;
return y;
public static void Main() {
// keep this function call here
var input ="hello world";
Console.WriteLine(FirstReverse(input));