Pokemon3D Script API Documentation

String

API documention for the Prototype String.
Prototype for the primitive string type.
Source code

Usage

var instance = new String(args);
...
instance.method(args);

Index


Constructor

Constructor constructor

Arguments: string valueUsage: var s = new String(value);

Variables

-- No Variables --

Getters & Setters

GetterStatic Method (get) empty
Static
Returns an empty string.

Type: stringUsage: var empty = String.empty;

Getter (get) length
Gets the amount of characters in the string.

Type: intUsage: var length = s.length;

Methods

charAt
Returns a character within the string.

Return: stringArguments: int indexUsage: var result = s.charAt(index);

concat
Concatenates multiple strings to this string.

Return: stringArguments: string[] ...stringsUsage: var result = s.concat(...strings);

endsWith
Returns whether the string ends with another string.

Return: boolArguments: string needleUsage: var result = s.endsWith(needle);

includes
Returns whether the string contains another string.

Return: boolArguments: string needleUsage: var result = s.includes(needle);

indexOf
Returns the index of the first occurrence of a string within this string.

Return: intArguments: string needleUsage: var result = s.indexOf(needle);

lastIndexOf
Returns the index of the last occurrence of a string within this string.

Return: intArguments: string needleUsage: var result = s.lastIndexOf(needle);

padEnd
Pads the end of the string until the string reaches a certain length.

Signatures:
Return: stringArguments: int targetLengthUsage: var result = s.padEnd(targetLength);

Return: stringArguments: int targetLength, string padStrUsage: var result = s.padEnd(targetLength, padStr);

padStart
Pads the start of the string until the string reaches a certain length.

Signatures:
Return: stringArguments: int targetLengthUsage: var result = s.padStart(targetLength);

Return: stringArguments: int targetLength, string padStrUsage: var result = s.padStart(targetLength, padStr);

remove
Removes a set of characters from the string.

Return: stringArguments: int startIndex, [int length]Usage: var result = s.remove(startIndex, [length]);

repeat
Repeats the string a number of times.

Return: stringArguments: int amountUsage: var result = s.repeat(amount);

replace
Replaces parts within the string with another string.

Return: stringArguments: string replace, string withUsage: var result = s.replace(replace, with);

slice
Returns a slice of the string.

Signatures:
Return: stringArguments: int startIndexUsage: var result = s.slice(startIndex);

Return: stringArguments: int startIndex, int lengthUsage: var result = s.slice(startIndex, length);

split
Splits the string at a delimiter.

Signatures:
Return: string[]Arguments: string[] delimiters, [int limit]Usage: var result = s.split(delimiters, [limit]);

Return: string[]Arguments: string delimiter, [int limit]Usage: var result = s.split(delimiter, [limit]);

startsWith
Returns whether the string starts with another string.

Return: boolArguments: string needleUsage: var result = s.startsWith(needle);

toLower
Converts all alphabetic characters in the string to their lower case counterparts.

Return: stringUsage: var result = s.toLower();

toUpper
Converts all alphabetic characters in the string to their upper case counterparts.

Return: stringUsage: var result = s.toUpper();

trim
Trims characters from the start and end of the string.

Signatures:
Return: stringUsage: var result = s.trim();

Return: stringArguments: string trimCharUsage: var result = s.trim(trimChar);

Return: stringArguments: string[] trimCharsUsage: var result = s.trim(trimChars);

trimEnd
Trims characters from the end of the string.

Signatures:
Return: stringUsage: var result = s.trimEnd();

Return: stringArguments: string trimCharUsage: var result = s.trimEnd(trimChar);

Return: stringArguments: string[] trimCharsUsage: var result = s.trimEnd(trimChars);

trimStart
Trims characters from the start of the string.

Signatures:
Return: stringUsage: var result = s.trimStart();

Return: stringArguments: string trimCharUsage: var result = s.trimStart(trimChar);

Return: stringArguments: string[] trimCharsUsage: var result = s.trimStart(trimChars);

Indexers

-- No Indexers --