I want to replace the 2nd last character in the end of my string builder in an easy and efficient way (ie fast speed and less memory). The string will be about 200-300 mb I guess (not sure). How do I do it ? Will the answer change if the input string also has a newline at its end ?
Thanks.