MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / stringReplace

Method stringReplace

src/main/java/util/StringUtils.java:35–49  ·  view source on GitHub ↗
(String aSearch, String aFind, String aReplace)

Source from the content-addressed store, hash-verified

33 private final static String[] badChars= { "?", "\\", "/", "*", ".", "\"", ":", "%", "@", "|", "<", ">", "COM", "LPT", "NULL", "PRINT"};
34
35 public static String stringReplace(String aSearch, String aFind, String aReplace) {
36 int pos = aSearch.indexOf(aFind);
37 if (pos != -1) {
38 StringBuffer buffer = new StringBuffer();
39 int lastPos = 0;
40 while (pos != -1) {
41 buffer.append(aSearch.substring(lastPos, pos)).append(aReplace);
42 lastPos = pos + aFind.length();
43 pos = aSearch.indexOf(aFind, lastPos);
44 }
45 buffer.append( aSearch.substring(lastPos));
46 aSearch = buffer.toString();
47 }
48 return aSearch;
49 }
50
51 public static String getSizeString(long number) {
52 StringBuffer suffix = new StringBuffer();

Callers 6

deTranslitMethod · 0.95
translitMethod · 0.95
replaceBadCharsMethod · 0.95
escapeTagsMethod · 0.95
unescapeTagsMethod · 0.95
toExtendedStringMethod · 0.95

Calls 2

appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected