Strings
String species are essentially lists of characters that are used to store words and sentences. Characters in turn can be represented by ASCII values. Please take the time to study the ASCII value table here.
String From List
list → string
Creates a string from a list of integers, using each integer as an ASCII code.
String To List
string → list
Creates a list of integers from a string, where each integer matches the ASCII code for the character at the corresponding place in the string.
Join String
str, str → str
Joins the string at the head to the end of the string below the head.
eg. “Hello”, “ World” → “Hello World”
Split String
str, num → str, str
Splits a string by a given number. The characters before the place given by the number are placed in one string, and those at or after that place are placed in another string.
eg. string, 3 → string of first 2 characters, string of characters in 3rd place and beyond
Substring
str, num, num → str, str
Pops a string and two numbers. Creates a new string starting from the character at the place matching the number below the head, and ending at the place matching the number at the head.
eg. “Hello”, 2, 4 → “ell”
To Lowercase
string → string
Sets all the characters in the string to lowercase.
To Uppercase
string → string
Sets all the characters in the string to uppercase.