Wheel IDE

Online demo »

String

This file contains procedures to handle strings.

Constants

The string module.
Source: lib/modules/string.whl, line: 9
MODULE_STRING10

System module calls.
Source: lib/modules/string.whl, line: 12
STRING_NUMBER_TO_STRING3
STRING_STRING_TO_NUMBER4
STRING_INDEX_OF5
STRING_SUB_STRING6
STRING_LENGTH7
STRING_EQUAL8
STRING_TO_UPPER_CASE9
STRING_TO_LOWER_CASE10
STRING_GET_CHAR_CODE_AT11
STRING_SET_CHAR_CODE_AT12

Procedures

numberToString
Source: lib/modules/string.whl, line: 24

Convert a number to a string.

proc numberToString(number n, string s)
Parameters:
NameTypeDescription
nnumberThe number to convert.
sstringThe 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:
NameTypeDescription
sstringThe 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:
NameTypeDescription
haystackstringThe haystack string.
needlestringThe string to find in the haystack.
startIndexnumberFrom 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:
NameTypeDescription
sstringThe source string.
startnumberThe start index in the source string.
lengthnumberThe length of the part of the string to copy.
resultstringThe result string.

length
Source: lib/modules/string.whl, line: 60

Get the length of a string.

proc length(string s)
Parameters:
NameTypeDescription
sstringThe string.
Return: The length.


compare
Source: lib/modules/string.whl, line: 68

Compare two strings.

proc compare(string s1, string s2)
Parameters:
NameTypeDescription
s1stringA string.
s2stringA string.
Return: 0 if not equal.


toUpperCase
Source: lib/modules/string.whl, line: 77

Upper case a string.

proc toUpperCase(string s)
Parameters:
NameTypeDescription
sstring

toLowerCase
Source: lib/modules/string.whl, line: 83

Lower case a string.

proc toLowerCase(string s)
Parameters:
NameTypeDescription
sstring

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:
NameTypeDescription
sstringThe string.
indexnumber
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:
NameTypeDescription
sstringThe string.
indexnumberThe index in the string.
charCodenumberThe char code.