I am trying to replace a space character into a hyphen I have in my string.
String replaceText = \"AT AT\"; replaceText.replace(\' \', \'-\');
Strings are immutable. You need to use the return value from replace:
replaceText = replaceText.replace(' ', '-');