AetherlangLib: Betterstrings

Betterstrings provides more tools for working with basic strings of characters. This library was introduced in v0.2.


charemp
charemplace str indx char @-> string
@ where str: string
@       indx: number
@       char: string
@ returns STR but with CHAR at INDX.

digit? str @-> void or 1
@ where str: string
@ returns 1 if all characters in STR are decimal digits and void otherwise.

printable? str @-> void or 1
@ where str: string
@ returns 1 if all characters in STR are printable and void otherwise.

punct? str @-> void or 1
@ where str: string
@ returns 1 if all characters in STR are used for punctuation and void otherwise.

strjoin arr [sep] @-> string
@ where arr: array
@       sep: string
@ concatenates all strings from ARR which should be an array of strings. If SEP is given, puts it in between.

strsplit str [sep] @-> array
@ where str: string
@       sep: string
@ splits STR into tokens by SEP, which defaults to " ".

tolowercase str @-> string
@ where str: string
@ makes STR lowercase-only.

touppercase str @-> string
@ where str: string
@ makes STR uppercase-only.

whitespace? str @-> void or 1
@ where str: string
@ returns 1 if all characters in STR are whitespaces and void otherwise.