Home arrow static arrow Java Programming [Archive] - Create an invisible special character...
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Create an invisible special character...
This topic has 5 replies on 1 page.

Posts:15
Registered: 6/28/03
Create an invisible special character...  
Aug 4, 2004 12:15 PM



 
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, I just want to see

"I am the man"

without the special character.

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!
 

Posts:6,750
Registered: 1/25/04
Re: Create an invisible special character...  
Aug 4, 2004 12:16 PM (reply 1 of 5)



 
System.out.println(ok.substring(0,ok.length() - 1);
 

Posts:2,206
Registered: 8/15/02
Re: Create an invisible special character...  
Aug 4, 2004 12:23 PM (reply 2 of 5)



 
        String myString = "My String" + (char)4;        System.out.println( myString );

Naughtily uses EOT as a delineator
 

Posts:31,095
Registered: 4/30/99
Re: Create an invisible special character...  
Aug 4, 2004 12:25 PM (reply 3 of 5)



 
Naughtily uses EOT as a delineator

That may or may not be "visible" depending on what "print" meant in the original post.
 

Posts:2,206
Registered: 8/15/02
Re: Create an invisible special character...  
Aug 4, 2004 12:30 PM (reply 4 of 5)



 
Granted, but I sort of assumed the OP is just using SOP or a FileWriter
 

Posts:14,142
Registered: 99-04-02
Re: Create an invisible special character...  
Aug 4, 2004 1:19 PM (reply 5 of 5)



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

yes... but why? what is the point of doing that?
 
This topic has 5 replies on 1 page.