• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to replace characters in string

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution I got from forums.java.sun.com:
(by anders.hedstrom )
 
I knew that guy would be trouble! Thanks tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic