File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes  Break a string with special characters into segments with only text no spec chars ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark " Break a string with special characters into segments with only text no spec chars ?" Watch " Break a string with special characters into segments with only text no spec chars ?" New topic
Author

Break a string with special characters into segments with only text no spec chars ?

Sanjeev Kulkarni
Greenhorn

Joined: Mar 20, 2006
Posts: 26
Hi,

I need to break a string with special characters into segments containing only text of the string , not the special chars like ",", " # ", " ", "$ " etc.. and then I need to compare the string with database string.

Ex: if string is: " #123, EPIP Phase, White#Field "
it has to be broken into:

Segment 1: 123
Segment 2: EPIP Phase
Segment 3: WhiteField

Can u pls help me with this ?


Thanks,
Sanlearns
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Have you checked out the String.split() method, it does exactly what you describe.



Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Alan Moore
Ranch Hand

Joined: May 06, 2004
Posts: 262
I think the other way 'round is easier:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Break a string with special characters into segments with only text no spec chars ?
 
Similar Threads
Saving Itinerary, yet again
Problem with encoding
need for a route entity/table/class
Price Itinerary
Delimiting Strings