String API Reference

 Hanlde String values.

The string type is basic one, and othe types, those are integer, double, has string value formatted to be suitable for each type.You can manipulate string variables with these functions and Cast them to other types.

These string function is based on Java language's ones. Alinous-Core just wrap the java functions with the JavaConnector.

addComma($number)

 Add commas every after 3 numbers. You can also use Number.format(intVal, pattern).

delete($str, $beginIndex, $endIndex)

 Delete a part of string.

endsWith($str, $suffix)

 Check if the $str ends with $suffix. Returned value is true or false.

escapeReplacement($str)

 Replace string without using escape character.

getAt($str, $i)

 Return a charactor at the position as string.

indexOf($str, $pattern, $begin)

 Return first index of $pattern in the $str, counting from $begin

indexOfBefore($str, $pattern, $end)

 Return last index before $end of $pattern in the $str

insert($str, $insStr, $offset)

 Insert $insStr into $str. Specify the position by $offset.

isAscii($str)

 Return if the string consisits of ascii charactors. Returned value is true or false.

isNumber($str)

 Check if the string is the number. Returned value is true or false.

lastIndexOf($str, $pattern)

 Return last index of $pattern in the $str

lastIndexOf($str, $pattern)

 Return last index of $pattern in the $str

length($str)

 Return length of the string.

match($str, $regExp)

 Return if $str matches. Returned value is true or false.

replaceNoRegex($str, $before, $after)

 Replace string without using regular expression.

split($str, $regex)

 Split string with token $regex, and return Array variable.

startsWith($str, $prefix)

 Check if the $str starts with $prefix. Returned value is true or false.

subString($str, $beginIndex, $endIndex)

 Return sub string.

toLowerCase($str)

 Convert string into lower case.

toUpperCase($str)

 Convert string into upper case.

trim($str)

 Trim string.


Go to Top