String
This file contains procedures to handle strings.
Constants
The string module.
Source: lib/modules/string.whl, line: 9
System module calls.
Source: lib/modules/string.whl, line: 12
STRING_NUMBER_TO_STRING | 3 |
STRING_STRING_TO_NUMBER | 4 |
STRING_INDEX_OF | 5 |
STRING_SUB_STRING | 6 |
STRING_LENGTH | 7 |
STRING_EQUAL | 8 |
STRING_TO_UPPER_CASE | 9 |
STRING_TO_LOWER_CASE | 10 |
STRING_GET_CHAR_CODE_AT | 11 |
STRING_SET_CHAR_CODE_AT | 12 |
Procedures
numberToString
Source: lib/modules/string.whl, line: 24
Convert a number to a string.
proc numberToString(number n, string s)
Parameters:
Name | Type | Description |
n | number | The number to convert. |
s | string | The string in which the number is stored. |
stringToNumber
Source: lib/modules/string.whl, line: 32
Convert a number to a string.
proc stringToNumber(string s)
Parameters:
Name | Type | Description |
s | string | The string to convert. |
indexOf
Source: lib/modules/string.whl, line: 40
Find one string in another string.
proc indexOf(string haystack, string needle, number startIndex)
Parameters:
Name | Type | Description |
haystack | string | The haystack string. |
needle | string | The string to find in the haystack. |
startIndex | number | From which character to start searching |
Return: The position of the needle in the haystack, -1 if not found.
subString
Source: lib/modules/string.whl, line: 50
Copy part of a string to another string.
proc subString(string s, number start, number length, string result)
Parameters:
Name | Type | Description |
s | string | The source string. |
start | number | The start index in the source string. |
length | number | The length of the part of the string to copy. |
result | string | The result string. |
length
Source: lib/modules/string.whl, line: 60
Get the length of a string.
proc length(string s)
Parameters:
Name | Type | Description |
s | string | The string. |
Return: The length.
compare
Source: lib/modules/string.whl, line: 68
Compare two strings.
proc compare(string s1, string s2)
Parameters:
Name | Type | Description |
s1 | string | A string. |
s2 | string | A string. |
Return: 0 if not equal.
toUpperCase
Source: lib/modules/string.whl, line: 77
Upper case a string.
proc toUpperCase(string s)
Parameters:
Name | Type | Description |
s | string | |
toLowerCase
Source: lib/modules/string.whl, line: 83
Lower case a string.
proc toLowerCase(string s)
Parameters:
Name | Type | Description |
s | string | |
getCharCodeAt
Source: lib/modules/string.whl, line: 89
Get a char code from an index in a string.
proc getCharCodeAt(string s, number index)
Parameters:
Name | Type | Description |
s | string | The string. |
index | number | |
Return: The char code.
setCharCodeAt
Source: lib/modules/string.whl, line: 97
Set a char code in a string.
proc setCharCodeAt(string s, number index, number charCode)
Parameters:
Name | Type | Description |
s | string | The string. |
index | number | The index in the string. |
charCode | number | The char code. |