Hello, I'm working on a project that reads conditions from an array and adds output to a string based on combinations of true conditions. In order to add together many different pieces of information, I added in a short " + " to the end of each of the pieces of information that are added to the string. This program runs through one hundred some odd lines of code, piecing together the string as it goes. Now I come to the final output, but I can't figure out how to truncate the end of the string, such that the combination text (" + ") is removed, seeing as there is no more possible data to add. I have tried to measure the length of the string via string.length(); and then shift the address over to the + to write over it by doing thus:
int L = string.length(); L--; string[L] = " "; string = string.trim();
However, the compiler tells me that I have an invalid conversion from 'const char*' to 'char' and will not compile. Is there a simple way that I can remove the last n characters from a string?