MCPcopy
hub / github.com/libgdx/libgdx / replace

Method replace

gdx/src/com/badlogic/gdx/utils/CharArray.java:1794–1798  ·  view source on GitHub ↗

Replaces a portion of this CharArray with another string. The length of the inserted string does not have to match the removed length. @param start the start index, inclusive @param end the end index, exclusive @param replaceStr the string to replace with @throws IndexOutOfBoundsException if the ind

(int start, int end, String replaceStr)

Source from the content-addressed store, hash-verified

1792 * @param replaceStr the string to replace with
1793 * @throws IndexOutOfBoundsException if the index is invalid */
1794 public CharArray replace (int start, int end, String replaceStr) {
1795 end = validateRange(start, end);
1796 replace(start, end, end - start, replaceStr, replaceStr.length());
1797 return this;
1798 }
1799
1800 /** Replaces the search string with the replace string throughout this CharArray. */
1801 public CharArray replaceAll (String searchStr, String replaceStr) {

Callers 3

replaceTestMethod · 0.95
replaceAllMethod · 0.95
replaceFirstMethod · 0.95

Calls 4

validateRangeMethod · 0.95
requireMethod · 0.95
getCharsMethod · 0.80
lengthMethod · 0.45

Tested by 1

replaceTestMethod · 0.76