functext_put
func text_put(place: int, text: string): int
Copies the bytes of text into memory at a place, and gives back the place after them
text: splitting, searching, cutting, changing and joining text, checking numbers, and sorting arrays. use "text.jamo"
Places count bytes from 0, like text[i] and len. Results are built in memory and made into text with memory_text in one go, so long text doesn't get joined a letter at a time.
func text_put(place: int, text: string): int
Copies the bytes of text into memory at a place, and gives back the place after them
func text_matches_at(text: string, part: string, at: int): bool
True if part is in text starting at that place. The place must leave room for part
func find(text: string, part: string): int
Where part first starts in text, or -1 if it isn't there. Empty part is found at 0
func contains(text: string, part: string): bool
func starts_with(text: string, part: string): bool
func ends_with(text: string, part: string): bool
func slice(text: string, from: int, to: int): string
The bytes from place from up to, but not including, place to. slice("hello", 1, 3) is "el"
func split(text: string, by: string): [string]
The pieces of text between each by. split("a,b,,c", ",") gives ["a", "b", "", "c"]
func text_is_space(code: int): bool
func trim(text: string): string
Text without the spaces, tabs and line endings at its start and end
func replace(text: string, old: string, new: string): string
Text with every old changed to new, from left to right
func upper(text: string): string
Text with small letters made into capitals: a to z, and the accented, Greek and Cyrillic letters (like é, ß stays, ω and ж). Anything else stays as it is
func lower(text: string): string
Text with capitals made into small letters, the same letters as upper
func text_change_case(text: string, to_upper: bool): string
Letters from U+0080 to U+07FF take two bytes in UTF-8, and every letter upper and lower change is one of them, so the text keeps its length
func text_upper_letter(letter: int): int
The capital of a two-byte letter, by its Unicode number, or the same number when it has none that's two bytes
func text_lower_letter(letter: int): int
The small letter of a two-byte capital, by its Unicode number
func letter_count(text: string): int
How many letters the text has. "héllo" has 6 bytes but 5 letters
func letters(text: string): [string]
The text split into its letters, each as its own text
func reverse_letters(text: string): string
The letters in the other order, keeping each letter's bytes together
func join(parts: [string], between: string): string
The parts in order with between in each gap. join(["a", "b"], ", ") is "a, b"
func repeat(text: string, times: int): string
The text that many times over. repeat("ab", 3) is "ababab"
func fixed(value: float, places: int): string
A float with exactly places digits after the dot: fixed(3.14159, 2) is "3.14". It rounds the number the way it reads, to 17 digits, with halves going up, so fixed(2.5, 0) is "3" and fixed(6.335, 2) is "6.34", the way you'd round by hand. places goes from 0 to 20. nan and the infinities come out as "nan", "inf" and "-inf"
func commas(value: int): string
An int with commas between each group of three digits: commas(1234567) is "1,234,567"
const TEXT_FLOAT_HIGH = "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792"
The same limits float() has. From here up, a decimal rounds past the largest float: 2^1024 - 2^970
const TEXT_FLOAT_LOW = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125"
At or below this, a decimal that isn't 0 rounds to 0: 2^-1075, all 1075 digits after the dot
func text_all_digits(text: string): bool
func text_without_leading_zeros(digits: string): string
func text_compare_digits(a: string, b: string): int
Below 0 when the whole number a is smaller than b, with neither having leading zeros
func is_int(text: string): bool
True when int(text) would work: digits with an optional minus sign, small enough for 64 bits
func is_float(text: string): bool
True when float(text) would work: digits with an optional minus sign, then maybe a dot and more digits, and not so large it rounds past the largest float or so small that a number that isn't 0 rounds to 0
func sort_ints(items: [int])
Sorts ints from smallest to largest
func text_before(a: string, b: string): bool
True if a comes before b, by comparing their bytes. All capitals come before small letters
func sort_strings(items: [string])
Sorts text by its bytes, so "Zoo" comes before "apple", and "app" before "apple"
func reverse_ints(items: [int])
func reverse_strings(items: [string])
func int_or(text: string, fallback: int): int
The text as an int, or fallback when it isn't one, like int_or(input(), 0)
func float_or(text: string, fallback: float): float