Re: hasNext?



i think what you want is "hasNext()".
forgive me if i'm mistaken but method "hasNext()" is a boolean method
which returns either true or false, depending on the expression @
hand.
for an instance, suppose you have a string as follows:

String str="my problems are gone!";

//(say) you want to print tokens(just words of the string) you'll do
the following.

while(str.hasNext())//here you are actually asking whether is it still
true that string str has a
//token? if its true, then there is a token,
otherwise, you won't enter the loop.
{
System.out.println(str.next());
}

---------------------------the
output----------------------------------------------------------------
my
problems
are
gone!
-----------------------------------------------------------------------------------------------------
"i stand to be corrected though"-but that what i know.
-----------------------------------------------------------------------------------------------------

sihle87
University of KwaZulu-Natal(South Africa)
Actuarial Student
-----------------------------------------------------------------------------------------------------
.



Relevant Pages

  • Re: Newbie Problem using if statement with &&
    ... >> John wrote: ... >>> string of 1 or 0 depending on what im sending. ...  > Yeah I have tested the vslues and they are valid. ...
    (comp.lang.php)
  • Re: Newbie Problem using if statement with &&
    ... Jerry Stuckle ... JDS Computer Training Corp. ... > string of 1 or 0 depending on what im sending. ...
    (comp.lang.php)
  • Re: Extract data from String
    ... I need to split this data out into separate columns. ... a random length depending on the data in it. ... string as it is, the following one shows how it should be split up into ... The same functions can be run from within VBA using the RUN ...
    (microsoft.public.excel.programming)
  • Re: Extract data from String
    ... Dim arrSegments, iLastSegment as integer ... I need to split this data out into separate columns. ... a random length depending on the data in it. ... string as it is, the following one shows how it should be split up into ...
    (microsoft.public.excel.programming)
  • Re: Calculate field values using javascript
    ... equals field 3 (this is in a php form) ... Also how can I set a field to be a value depending on what the user ... Then ADDR.value is, for the sort of control in question, a String ... So: var Qty1 = +ADDR1.value ...
    (comp.lang.javascript)