Link

Strings


charcode

int charcode(string text)

Returns ASCII code for the first character in given string.


get_string_pointer

sfall.h

int get_string_pointer(string text)

Returns a pointer to a string variable or to a text.

This is a macro, you need to include sfall.h to use it.


string_split

array string_split(string, split)

Takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. You can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))


strlen

int strlen(string text)

Returns string length.


substr

string substr(string, start, length)

Cuts a substring from a string starting at start up to length characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 characters: “st”). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: “te”)