For an exercise on codewars I had to remove the first and last character of a string. After some fidling about I found a solution that works:
public static string Remove_char(string s)
{
return s.Substring(1, s.Length - 2);
}
My question is why do I have to use -2 instead of -1 at the end of the return line when I only want to remove the last character?