See if this helps:
http://java.sun.com/j2se/1.3/docs/api/index.html
substring
public String substring(int start)
Returns a new String that contains a subsequence of characters currently
contained in this StringBuffer.The substring begins at the specified index
and extends to the end of the StringBuffer.
Parameters:
start - The beginning index, inclusive.
Returns:
The new string.
Throws:
StringIndexOutOfBoundsException - if start is less than zero, or greater
than the length of this StringBuffer.
Since:
1.2
----------------------------------------------------------------------------
----
substring
public String substring(int start,
int end)
Returns a new String that contains a subsequence of characters currently
contained in this StringBuffer. The substring begins at the specified start
and extends to the character at index end - 1. An exception is thrown if
Parameters:
start - The beginning index, inclusive.
end - The ending index, exclusive.
Returns:
The new string.
Throws:
StringIndexOutOfBoundsException - if start or end are negative or greater
than length(), or start is greater than end.
Since:
1.2
-----Original Message-----
From: Valderrama, Eric [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 3:36 PM
To: [EMAIL PROTECTED]
Subject: How can I search for a substring in a StringBuffer object and
the replace it?
Hi,
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?
I tried to use indexOf() method but it didn't work because it belongs to
String class.
I hope you can help me
Thanks
-Eric.-
___________________________________________________________________________
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