Chapter 5. Functions

Table of Contents

String functions
Kommander functions
Array functions
File functions
Input functions
Message functions

Most old parser functions are supported by new parser. Also, some new functions were added.

String functions

String functions are the same as in old parser, the only difference is that their names are preceeded by str_ instead of @String.
  • str_length(string) - returns length of string
  • str_contains(string, text) - returns 1 if string contains text
  • str_find(string, text, start) - returns position of the first occurence of text in string; optional start specifies start of the search
  • str_find(string, text, start) - returns position of the last occurence of text in string; optional start specifies start of the search
  • str_left(string, count) - returns first count characters of string
  • str_right(string, count) - returns last count characters of string
  • str_right(string, start, count) - returns substring of string starting from start and containing count characters (or everything to the end of the string if last parameter is not specified)
  • str_remove(string, text) - returns string with all substrings equal to text removed
  • str_replace(string, text, text2) - returns string with all substrings equal to text replaced with text2
  • str_lower(string) - returns string converted to lowercase
  • str_upper(string) - returns string converted to uppercase
  • str_section(string, separator, start, end) - returns substring containing appropriate sections of string determined by separator; if no end is given, single start section is returned
  • str_args(string, ...) - returns string with %1, %2, %3 replaced with following parameters.
  • str_isnumber(string) - returns 1 if string is a valid number
  • str_isempty(string) - returns 1 if string is empty
  • str_toint(string, default) - returns string converted to integer; if conversion is not possible, optional default value is returned
  • str_todouble(string, default) - returns string converted to double; if conversion is not possible, optional default value is returned