st.replaceAll("\\s+","") and st.replaceAll("\\s","") produce the same result.
The second regex is 20% faster than the first one, but as the number consecutive spaces increases, the first one performs better than the second one.
Assign the value to a variable, if not use directly:
st = st.replaceAll("\\s+","")