aspose 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 1295
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Break a string with special characters into segments with only text no spec chars ?
 
Similar Threads
need for a route entity/table/class
Delimiting Strings
Problem with encoding
Price Itinerary
Saving Itinerary, yet again