MCPcopy Create free account
hub / github.com/davidgiven/luje / setCharAt

Method setCharAt

lib/java/lang/AbstractStringBuilder.java:518–527  ·  view source on GitHub ↗

Sets the character at the index. @param index the zero-based index of the character to replace. @param ch the character to set. @throws IndexOutOfBoundsException if index is negative or greater than or equal to the current {@link #length

(int index, char ch)

Source from the content-addressed store, hash-verified

516 * current {@link #length()}.
517 */
518 public void setCharAt(int index, char ch) {
519 if (0 > index || index >= count) {
520 throw new StringIndexOutOfBoundsException(index);
521 }
522 if (shared) {
523 value = value.clone();
524 shared = false;
525 }
526 value[index] = ch;
527 }
528
529 /**
530 * Sets the current length to a new value. If the new length is larger than

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected