|
|
|
|
@ -416,14 +416,14 @@ public abstract class StringUtils {
@@ -416,14 +416,14 @@ public abstract class StringUtils {
|
|
|
|
|
int pos = 0; // our position in the old string
|
|
|
|
|
int patLen = oldPattern.length(); |
|
|
|
|
while (index >= 0) { |
|
|
|
|
sb.append(inString.substring(pos, index)); |
|
|
|
|
sb.append(inString, pos, index); |
|
|
|
|
sb.append(newPattern); |
|
|
|
|
pos = index + patLen; |
|
|
|
|
index = inString.indexOf(oldPattern, pos); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// append any characters to the right of a match
|
|
|
|
|
sb.append(inString.substring(pos)); |
|
|
|
|
sb.append(inString, pos, inString.length()); |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|