Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StringTokenizer ??  RSS feed

 
Tom Caldwell
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure this is easy to do but I'm not getting it. ?
All I need to do is parse a string in the middle and take the 2nd half as in
select * from table where something = something
I need to get from "where" on, isn't StringTokenizer the way to do this ?
Thanks
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I thought the same but it seems that a string tokenizer can't parse based on strings (only characters). You pass a string to the constructor but this is treated as a list of delimiters not as a single delimiter. So, short of using a regex package, you could use some of the String methods like so.

Sean
[This message has been edited by Sean MacLean (edited June 22, 2001).]
 
Tom Caldwell
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sean,
That works fine, I'll use it.
Still seems like a lot of work to do something so simple ?
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there's promise for the future. Java 1.4 (beta) includes a java regex api. This will really help with string manipulation.
Sean
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!