• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

getting the words alone  RSS feed

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was given this
example
when i post the same question
well... i am still confused... of how to use it....
what is a nval?
how do i intialize it?

well i tried... one of the examples from a website




I still do not know how to parse this line???
String str ="int one, two , three ,four , five,six,seven"
the words like five, six,seven happens as a single String... how do i parse them??
please help

[ July 15, 2006: Message edited by: catherine matthews ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The notation "instream.nval" tells you nval is a member on instream, which was declared as a StreamTokenizer. The doc for StreamTokenizer says nval is ...


There are many ways to parse a string. You can look into StringTokenizer (actually don't ... Sun says don't use it in new programs any more), String.split(), and the whole world of regular expressions.

I haven't used StreamTokenizer but see if setting wordChars() and whitespaceChars() would help you break on commas.
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!