Name: joT67522 Date: 09/05/97
There is no way to easily change a character or a string within
a StringBuffer, but it would be vastly easier to add one than
to force everyone to do multiple convert to character string
and then append to accoplish the same task.
There are two basic types of replace, one which changes the
length of the string and the other that doesn't, each requires
their own methods under the general replace name.
Methods that do not change StringBuffer length.
StringBuffer.replace(int, char) - replaces charAt int with char
StringBuffer.replace(int, String) - replaces the characters
starting at int with String
Note: one must consider if int + String.length exceeds
the current length of the StringBuffer whether this is an error
or not.
Methods that do change StringBuffer length
StringBuffer.replace(int1, int2, String) - replaces the int2
characters starting at int1 with String
Note: This is esentialy a delete followed by an insert.
company - Cash Markets Group , email - ###@###.###
======================================================================
- duplicates
-
JDK-4088691 StringBuffer needs more methods
-
- Closed
-
-
JDK-4071742 RFE: Allow ability to replace substrings with other strings
-
- Closed
-
-
JDK-4120694 StringBuffer should have more functionality
-
- Closed
-
- relates to
-
JDK-4162796 Request additional API's for StringBuffer searching capability
-
- Resolved
-