Questions of general Java API usage are OFF-TOPIC for servlet interest
and should be directed to a more appropriate forum such as
news://comp.lang.java.programmer or
http://www.javaranch.com/cgi-bin/ubb/Ultimate.cgi or
http://forum.java.sun.com/list/discuss.sun.java.programming.lang
You are correct, there's no single method in StringBuffer to get the
index of a given substring. Here are some ideas:
- parse through the StringBuffer character by character using charAt(),
find the desired substring
- use substring() to search the StringBuffer
- convert to a string, use string indexOf
"Valderrama, Eric" wrote:
>
> Please correct me if I'm wrong but there's not a method in StringBuffer
> class to search a substring in a StringBuffer variable and then to get the
> index or the position where the substring is.
> How can I do that?
___________________________________________________________________________
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