MCPcopy
hub / github.com/libgdx/libgdx / replaceAll

Method replaceAll

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

Returns the number of replacements done. @param value the char to be replaced @param replacement all occurrences of value will be replaced by this replacement @return the number of replacements done

(char value, char replacement)

Source from the content-addressed store, hash-verified

261 * @param replacement all occurrences of value will be replaced by this replacement
262 * @return the number of replacements done */
263 public int replaceAll (char value, char replacement) {
264 int replacements = 0;
265 if (value != replacement) {
266 char[] items = this.items;
267 for (int i = 0, n = size; i < n; i++) {
268 if (items[i] == value) {
269 items[i] = replacement;
270 replacements++;
271 }
272 }
273 }
274 return replacements;
275 }
276
277 public boolean contains (char value) {
278 int i = size - 1;

Callers 2

toStringMethod · 0.95
replaceTestMethod · 0.95

Calls 3

indexOfMethod · 0.95
replaceMethod · 0.95
lengthMethod · 0.45

Tested by 2

toStringMethod · 0.76
replaceTestMethod · 0.76