Implements String.delete(char oldChar, String newChar), StringBuffer and

StringBuilder delete(int startIndex, int endIndex), and
replace (int startIndex, int endIndex, String replacementString)
This commit is contained in:
Eric Scharff
2007-10-29 15:07:36 -06:00
parent 78ee14fff5
commit bcd2c75f41
3 changed files with 52 additions and 0 deletions

View File

@ -60,6 +60,11 @@ public class StringBuffer {
return this;
}
public synchronized StringBuffer delete(int start, int end) {
sb.delete(start, end);
return this;
}
public synchronized StringBuffer deleteCharAt(int i) {
sb.deleteCharAt(i);
return this;
@ -73,6 +78,11 @@ public class StringBuffer {
return sb.length();
}
public synchronized StringBuffer replace(int start, int end, String str) {
sb.replace(start, end, str);
return this;
}
public synchronized void setLength(int v) {
sb.setLength(v);
}