Tyl Programming Language
▶ STRING MODULE REFERENCE
string.chars string chars
string - A string variable.
chars - Gets list of all characters in string.
string.end string search_string → result
string - A string variable.
search_string - String to search for.
result - Whether search_string is at the end of string.
string.flatten stringstring
string - Causes string content to be as it was written, regardless of special escaping rules.
string.index string search_string → index
string - A string variable.
search_string - String to search for.
index - Searches for search_string in string. If found, returns the position (index), otherwise returns -1.
string.insert string position insert_string
string - A string variable.
position - Where to insert insert_string.
insert_string - Inserts insert_string at position in string.
string.lines string lines
string - A string variable.
lines - Gets list of all lines in string.
string.replace string search_string replace_string → replaced_string
string - A string variable.
search_string - String to search for.
replace_string - Replacement string.
replaced_string - Searches for search_string in string. Replaces all occurrences with replace_string, and returns the modified string.
string.section string start length → section
string - A string variable.
start - Index of section start.
length - Length of section.
section - Returns a section of string, starting at start, with size of length.
string.split string split_string sections
string - A string variable.
split_string - A string that separates between sections.
sections - Gets list of all sections in string that are split by split_string.
string.start string search_string → result
string - A string variable.
search_string - String to search for.
result - Whether search_string is at the start of string.
string.trim string → trimmed_string
string - A string variable.
trimmed_string - string without trailing and ending white-space characters.