I want to concatenate a string before the last occurrence of any character.
I want to do something like this:
addToString(lastIndexOf(separator), string);
where "ddToString" is a function that adds the line " before " lastIndexOf (delimiter) "
Any ideas?
One of the ways I was thinking about is string = string + separator . But I can't figure out how to overload the concatenate function to concatenate after a specific index.
source share