I want to create a function that flips a string's order
example: "hi" => "ih"
here is the code I have come out with so far:
public static string Flip(this string Str)
{
char[] chararray = Str.ToCharArray();
string output = "";
chararray. //i dont know what methoud should be used to execute action
return output;
}
the thing is, i want to know within the lambda expression what is the index of the object that is currently selected ex:x
in (x => x )
indexOf
is not an option as there can be more then one char from the same type
how can I know the index?
edit: I don't want to know how to reverse a string, I want to know how to find an index of an object in lambda expression