The list of methods to do String Replace are organized into topic(s).
List
getLineBreakOffsets(String replacementString)
get Line Break Offsets
ArrayList<Integer> ret = new ArrayList<Integer>();
int lineBreaks = 0;
int ignoreNextNAt = -1;
for (int i = 0; i < replacementString.length(); i++) {
char c = replacementString.charAt(i);
if (c == '\r') {
lineBreaks++;
ret.add(i);
...
String
replace(String source, Properties properties) replace
HashMap<String, String> map = new HashMap<String, String>(properties.size());
Iterator<Object> iter = properties.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
map.put(key, properties.getProperty(key));
return replace(source, map);
String
replace(String source, String oldChars, String newChars) Method replace.
if (source == null)
return null;
if (oldChars == null || oldChars.length() == 0 || newChars == null || source.indexOf(oldChars) == -1)
return source;
if (source.equals(oldChars))
return newChars;
StringBuffer buffer = new StringBuffer(source.length());
List<String> tokens = split(source, oldChars);
...
String
replace(String str) Replaces the /'s with this systems file separator
String sep = System.getProperty("file.separator");
if (sep.equals("/"))
return str;
StringTokenizer tok = new StringTokenizer(str, "/");
String tmp = tok.nextToken();
while (tok.hasMoreTokens()) {
tmp += sep + tok.nextToken();
if (str.endsWith("/"))
tmp += sep;
return tmp;
String
replace(String string, String pattern, String value) Replaces all occurrences of "pattern" in "string" with "value"
if (pattern.length() == 0)
return string;
StringBuilder returnValue = new StringBuilder();
int patternLength = pattern.length();
while (true) {
int idx = string.indexOf(pattern);
if (idx < 0) {
break;
...
String
replace(String string, String pattern, String value) Replaces all occurrences of "pattern" in "string" with "value"
if (pattern.length() == 0) {
return string;
StringBuffer returnValue = new StringBuffer();
int patternLength = pattern.length();
while (true) {
int idx = string.indexOf(pattern);
if (idx < 0) {
...