Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sanjeev Kulkarni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked out the String.split() method, it does exactly what you describe.

 
Alan Moore
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the other way 'round is easier:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic