| Author |
how to replace characters in string
|
aulo aasmaa
Greenhorn
Joined: Aug 06, 2001
Posts: 15
|
|
Background: I have a JTable (the problem is not in swing), where I have some columns of numbers. All numbers are formatted, so that 1000 becomes 1 000.00 or 1'000.00 and 12.1 becomes 12.10 Problem: One of my processes understands the decimal places, but gives an error to the apostrophes (') and spaces. Question: How do I replace these characters with nothing? I mean How do I get from 1'000.00 to 1000.00, the decimal places remain, I only need to get rid of the bad characters. Code Tnx! [This message has been edited by aulo aasmaa (edited August 15, 2001).]
|
 |
aulo aasmaa
Greenhorn
Joined: Aug 06, 2001
Posts: 15
|
|
OK, found a way to handle the problem, but a new one appeared right away. The following code transforms 1'000.00 to 1 000.00, but this is no good. I would like to get rid of the space as well, but I cannot declare the "newchar" as '' How do I remove the space?
|
 |
aulo aasmaa
Greenhorn
Joined: Aug 06, 2001
Posts: 15
|
|
The solution I got from forums.java.sun.com: (by anders.hedstrom )
|
 |
 |
|
|
subject: how to replace characters in string
|
|
|