DescriptionYarn is a library which provides various string processing functions. All functions return new strings and will not taint the inputs.InstructionsSPLIT$(string$,separator$)
Splits string$ into substrings at each occurrence of separator$ and returns a new string array containing every substring (including empty ones.) If separator$ is the empty string, the output array is the list of every character in the string. Commonly used with JOIN$().
OUT$=SPLIT$("HELLO WORLD"," ")
FOR I%=0 TO LEN(OUT$)-1
This is a function which returns an array, which usually isn't standard practice in SB. Use carefully.JOIN$(array$,separator$)
Returns a new string by joining all of the entries in array$ together, with separator$ placed between them. Commonly used with SPLIT$().
PRINT JOIN$(IN$,",") 'APPLE,BANANA,ORANGE
Returns a new version of string$ where all occurrences of old$ are replaced with new$.
PRINT REPLACE$("HELLO WORLD","L","Q") 'HEQQO WORQDCOUNT(string$,substring$)
Returns the number of times substring$ occurs in string$, as an integer.
PRINT COUNT("AABAA","A") '4UPPER$(string$)
Returns a new version of string$ where every lowercase letter is uppercase. Does not touch any other characters. Supports most (if not all) alphabets in SB's character set.
PRINT UPPER$("Hello wORLD") 'HELLO WORLDLOWER$(string$)
Returns a new version of string$ where every uppercase letter is lowercase. Does not touch any other characters. Supports most (if not all) alphabets in SB's character set.
PRINT LOWER$("Hello wORLD") 'hello worldREVERSE$(string$)
Returns a backwards version of string$.
PRINT REVERSE$("HELLO WORLD") 'DLROW OLLEHTRIM$(string$)
Returns a version of string$ with leading and trailing whitespace removed. Whitespace characters are tab, space, linefeed, and carriage return.
PRINT TRIM$(" A ") 'AREST$(string$,start%)
Returns the rest of string$ starting at start%. In other words, returns a substring of string$ which starts at start% and runs to the end of the string.
PRINT REST$("HELLO WORLD",6) 'WORLD