Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

String Tokenizer

 
armo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,

I am trying to tokenize a String that contains HTML tags. Can anyone help me with that?

Any hints will be appreciated.
Thanks.
 
Dun Dagda
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Report post to moderator
To tokenize your string, you might try the split(...) method of the String class. It takes a regular expression as its argument, so you might want to look up the java documentation on regular expressions. A helpful link that I found is this regex recipes pdf file.

There is also a StringTokenizer class, but its use in code is no longer recommended by Sun.

DD
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Report post to moderator
Compscience Compscience,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Report post to moderator
Round these parts, posting the same question in multiple forums is bad practice. It can make it rather difficult to follow a conversation, plus folks spend time saying things that were just said.

Please continue this conversation in the duplicate thread. I'm closing this thread.
 
    Bookmark Topic Watch Topic
  • New Topic