• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

StringTokenizer ??

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic