aspose file tools*
The moose likes Java in General and the fly likes Strip Characters out of String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Strip Characters out of String" Watch "Strip Characters out of String" New topic
Author

Strip Characters out of String

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
I need help to strip all characters out of a string except numbers and commas's.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11402
    
  16

What have you tried?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
fred rosenberger wrote:What have you tried?


I have this but it will strip out even the commas

Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

You've told it not to strip only digits. Would adding comma do the job:


The quieter you are, the more you are able to hear.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
Kemal Sokolovic wrote:You've told it not to strip only digits. Would adding comma do the job:


That worked great. Thanks
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strip Characters out of String