sorry doug, that wasn't meant to be a direct reply, just pushed the reply
button that's all.

now that you've started this, take a look at the Java-API, check out
String.indexOf(String str, int index) it states quite clearly that it will
RETURN THE INDEX OF THE SUBSTRING(SUBSTRING, for your information could be a
whole string or a part of it, so this method works for something like
"CANCATENATE" as well as it does for "CATTLE"). i would also urge you to
read what i had written once again, i think i made it quite clear that you
are to USE THE INDEX AND THE QUERY STRING LENGTH TO OBTAIN THE SUBSTRING and
do whatever the heck you want to with it.

i don't quite feel i need to take a stab at anything you've written... what
you write's your prerogative. however, i would suggest you leave it to the
moderators to decide what questions get posted to this list and if you don't
like them, ignore them and quit flaming people.

sans adieu
vijay

-----Original Message-----
From: Doug Turner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 26, 2000 12:04 PM
To: [EMAIL PROTECTED]
Subject: Re: about the stringtokenzier


Why are you replying to me directly?  I didn't ask the question.

Of course, this won't separate words from text...if I am looking for "cat"
your method would return a false positive for text containing the word
"cattle"; and don't tell me that I should search for the string " cat ",
what about cat ending a sentence, before other punctuation, beginning/end of
line, etc., etc.  Since you are having problems answering fan yuan's
question, perhaps you can take a stab at mine below...

----- Original Message -----
From: Vijay <[EMAIL PROTECTED]>
To: Doug Turner <[EMAIL PROTECTED]>
Sent: Tuesday, July 25, 2000 10:32 PM
Subject: RE: about the stringtokenzier


> token is a character or a series of characters(which would explain the
> string for the delimiter parameter here).
>
> if you want to find a whole word, i suggest you use indexOf(String str,
int
> idx)(in java.lang.String). str would be the word you want to search for
and
> idx if the index at which you want to start the search, this'll return the
> index at which first occurance of str from the given index can be found.
use
> the index value and strs length to do whatever you want with that string
> thereafter. to find more of the same string, you could loop and set index
to
> newIdx+str.length().
>
> sans adieu,
> vijay
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Doug Turner
> Sent: Wednesday, July 26, 2000 10:54 AM
> To: [EMAIL PROTECTED]
> Subject: Re: about the stringtokenzier
>
>
> And this relates to servlets in what way?
>
> ----- Original Message -----
> From: fan yuan <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 25, 2000 6:27 PM
> Subject: about the stringtokenzier
>
>
> > Hi! every java fan
> > I have met such a problem.
> > I would like to find the string in a setence and mark it to red.
> > I use stringTokenizer(inputstr,str) to get the point and mark it .
> > but it seems that it will split the str into every char and check it.
> > for example: the setence
> > good health medi
> > it will become
> >  good hmedialth medi
> >  I want check the whole word ?
> >  How can I ?
> >
> >
> >
> > Best regards,
> >  fan                            mailto:[EMAIL PROTECTED]
> >
> >
>
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to