Hello...

I need to add a special character to a string as follows..

String ok = "I am the man"+specialChar;

However, when I print "ok" later,without taking substring, I just want to see

"I am the man "

with the special character but will be invisible and will have just a space.

The reason I want to do this is because I want to distinguish the regular strings with the strings invisible special character.

How can I do this? Any help would be greatly appreciated.

Thanks!

Will String.replaceAll do for you?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.