When I try to remove the last few characters of a string, I get an index out of range error. I am using the following to remove the characters from the end of the string:
objJSONStringBuilder.Remove(objJSONStringBuilder.Length - 1, 6)
The string has <hr /> at the end which I want to remove.
The first parameter is the index from where you want to start removing. Use
objJSONStringBuilder.Remove(objJSONStringBuilder.Length - 6, 6)