I have:
String test = "Hello,";
String test2 = "Hello";
I want to replace the last character if it is a comma with an empty string. I currently have:
String var = test.Remove(str.Length - 1, 1) + "";
String var = test2.Remove(str.Length - 1, 1) + "";
That would always replace the last character, even if it was not a comma.