I am trying to parse a string and I need to use substring to do it. The string contains the apostrophe characters. My question is, how do I use temp to get String.indexOf to get the index of the apostrophe character?
//temp variable currently contains the string 'hello' including the apostrophe character
String finalWord = temp.substring(temp.indexOf('''), temp.indexOf('.'));
Your variable name is wrong(
finalis a reserved word) and you should use escape character: