MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / substring

Method substring

vm/JavaAPI/src/java/lang/String.java:756–765  ·  view source on GitHub ↗

Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. Examples: "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".substring(9) returns "" (an empty string

(int start)

Source from the content-addressed store, hash-verified

754 * "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".substring(9) returns "" (an empty string)
755 */
756 public java.lang.String substring(int start){
757 if (start == 0) {
758 return this;
759 }
760 if (start >= 0 && start <= count) {
761 //return new String(offset + start, count - start, value);
762 return new String(value, offset + start, count - start);
763 }
764 throw new ArrayIndexOutOfBoundsException(start);
765 }
766
767 /**
768 * Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

Callers 15

childToDisplayLabelMethod · 0.95
buildRequestBodyMethod · 0.95
replaceMethod · 0.95
fieldNameMethod · 0.95
longValMethod · 0.95
resolveBufferMethod · 0.95
readImageBytesMethod · 0.95
colorMethod · 0.95
parseMethod · 0.95
formatTimeMethod · 0.95
runMethod · 0.95

Calls

no outgoing calls