lib.strings
Sfall string library functions Converted from headers/sfall/lib.strings.h @author phobos2077
Functions
Section titled “Functions”string_contains
Section titled “string_contains”function string_contains(str: string, sub: string): boolean
Check if str contains sub anywhere
string_starts_with
Section titled “string_starts_with”function string_starts_with(str: string, sub: string): boolean
Check if str starts with sub
string_join
Section titled “string_join”function string_join(array: SfallList<string>, join: string): string
Join array of strings with delimiter
string_repeat
Section titled “string_repeat”function string_repeat(str: string, count: number): string
Create string by repeating str count times
string_split_ints
Section titled “string_split_ints”function string_split_ints(str: string, split: string): SfallList<number>
Split string and convert parts to integers
string_to_int
Section titled “string_to_int”function string_to_int(str: string): number
atoi wrapper for use as delegate
string_to_float
Section titled “string_to_float”function string_to_float(str: string): number
atof wrapper for use as delegate
to_string
Section titled “to_string”function to_string(val: any): string
Convert value to string
string_null_or_empty
Section titled “string_null_or_empty”function string_null_or_empty(str: string): boolean
Check if string is null or empty
parse_str_2
Section titled “parse_str_2”function parse_str_2(str: string, x1: any, x2: any): string
Parse string template with %1% and %2% placeholders. Example: parse_str_2(“Hello, %2%. I have $%1%.”, 100, “World”) -> “Hello, World. I have $100.”