The String library contains functions quite similar to the ones found in the
JavaScript
String object.
Function |
Description |
charAt() |
Returns a character that is placed in a specified position of
a string |
compare() |
Compare two strings, and returns an integer that tells if
the one string is identical, smaller or larger than the other |
elementAt() |
Separates a string into elements, and then return a
specified element |
elements() |
Returns the number of times a specified value appears in a string |
find() |
Returns the position of a substring in a string |
format() |
Formats a value, and returns the result |
insertAt() |
Separates a string into elements, inserts a substring,
and then return the result |
isEmpty() |
Returns a boolean value that is true if the string is empty,
and false if not |
length() |
Returns the length of a string |
removeAt() |
Separates a string into elements, removes an element, and
then return the result |
replace() |
Replaces a part of a string with a new string,
and return the result |
replaceAt() |
Separates a string into elements, replaces an element, and
then return the result |
squeeze() |
Reduces all white spaces to
single spaces, and returns the result |
subString() |
Returns a string that is a specified part of another string |
toString() |
Creates a string from a number, and return the result |
trim() |
Returns a string without leading and trailing spaces |
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.