public class TestString{ public static void replaceStr(){ String trial1=""; String trial2="arun'"; trial1=trial2.replaceAll("\'",""); System.out.println(trial2); System.out.println(trial1);
} public static void main(String args[]){ replaceStr(); } }
Originally posted by Fernando Dominguez: I notice that � this character does not exits in the ascii code, � � exits in the extended ascci code but not � alone.
It is in Unicode; look in Latin-1; its code number is 0x00b4.
Yong Mook Kim
Greenhorn
Joined: Nov 17, 2008
Posts: 6
posted
0
Originally posted by Fernando Dominguez: Are you working on a windows machine?
I am working on an UNIX machine I tried the "original" replaceAll on a windows machine and It worked.
So problem could be the way that both OS/editors uses the caracters.
Yes, i tested on windows platform. Thanks for info. I will be careful on my UNIX production server when dealing with special characters.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
4
posted
0
That is peculiar; Java supports the whole of Unicode, and it is usually only a problem on Windows because the Windows command prompt doesn't support special characters. I don't use Unix, but the special character support on Linux which is similar to Unix is usually better than on Windows.
vipin jos
Greenhorn
Joined: Nov 18, 2008
Posts: 24
posted
0
Can you check what is the value you are getting for the following in Windows and Unix?