String.replace, trim, nothing works.

Hi, I have a string that contains some sort of invisible characters that store up and mess my code up because it expects a certain string length and more spaces keep adding on. Why does String.trim() or String.replace(" ", "") not work?

I have a string

The, why are you using String functions? Strings and strings are not the same thing.

Where is your code?