I am trying to replace a space character into a hyphen I have in my string.
String replaceText = \"AT AT\"; replaceText.replace(\' \', \'-\');
replaceText = replaceText.replace(' ', '-');
Strings are immutable, they cannot be changed after creation. All methods that somehow modify a string will return a new string with the modifications incorporated.