Functions

string.inc

Function Type Description
add native Concatenates one string onto another.
argparse native Parses an argument string to find the first argument. You can use this to
replace strbreak().
contain native Tests whether a string is found inside another string.
containi native Tests whether a string is found inside another string with case ignoring.
copy native Copies one string to another string.
copyc native Copies one string to another string until ch is found.
equal native Returns whether two strings are equal.
equali native Returns whether two strings are equal with case ignoring.
float_to_str native Converts a floating point number to a string.
fmt native Formats and returns a string according to the AMX Mod X format rules
(see documentation).
format native Formats a string according to the AMX Mod X format rules (see documentation).
format_args native Gets parameters from function as formated string.
formatex native Formats a string according to the AMX Mod X format rules (see documentation).
get_char_bytes native Returns the number of bytes a character is using. This is
for multi-byte characters (UTF-8). For normal ASCII characters,
this will return 1.
is_char_lower native Returns whether an alphabetic character is lowercase.
is_char_mb native Returns if a character is multi-byte or not.
is_char_upper native Returns whether an alphabetic character is uppercase.
is_string_category native Checks if the input string conforms to the category specified by the flags.
isalnum native Returns whether a character is numeric or an ASCII alphabet character.
isalpha native Returns whether a character is an ASCII alphabet character.
isdigit native Returns whether a character is numeric.
isspace native Returns whether a character is whitespace.
mb_strtolower native Performs a multi-byte safe (UTF-8) conversion of all chars in string to lower case.
mb_strtotitle native Performs a multi-byte safe (UTF-8) conversion of all chars in string to title case.
mb_strtoupper native Performs a multi-byte safe (UTF-8) conversion of all chars in string to upper case.
mb_ucfirst native Performs a multi-byte safe (UTF-8) conversion of a string's first character to upper case.
num_to_str native Converts an integer to a string.
parse native Gets parameters from text.
replace native Given a string, replaces the first occurrence of a search string with a
replacement string.
replace_string native Given a string, replaces all occurrences of a search string with a
replacement string.
replace_stringex native Given a string, replaces the first occurrence of a search string with a
replacement string.
setc native Sets string with given character.
split_string native Returns text in a string up until a certain character sequence is reached.
str_to_float native Converts a string to a floating point number.
str_to_num native Converts a string to an integer.
strcat native Concatenates one string onto another.
strcmp native Compares two strings lexographically.
strfind native Tests whether a string is found inside another string.
strlen native Calculates the length of a string.
strncmp native Compares two strings parts lexographically.
strtof native Parses the 'string' interpreting its content as an floating point number and returns its value as a float.
The function also sets the value of 'endPos' to point to the position of the first character after the number.

This is the same as C++ strtod function with a difference on second param.

The function first discards as many whitespace characters as necessary until the first
non-whitespace character is found. Then, starting from this character, takes as many
characters as possible that are valid and interprets them as a numerical value.
Finally, a position of the first character following the float representation in 'string'
is stored in 'endPos'.

If the first sequence of non-whitespace characters in 'string' is not a valid float number
as defined above, or if no such sequence exists because either 'string' is empty or it contains
only whitespace characters, no conversion is performed.
strtok native Breaks a string in two by token.
strtok2 native Breaks a string in two by token.
strtol native Parses the 'string' interpreting its content as an integral number of the specified 'base',
which is returned as integer value. The function also sets the value of 'endPos' to point
to the position of the first character after the number.

This is the same as C++ strtol function with a difference on second param.

The function first discards as many whitespace characters as necessary until the first
non-whitespace character is found. Then, starting from this character, takes as many
characters as possible that are valid following a syntax that depends on the 'base' parameter,
and interprets them as a numerical value. Finally, a position of the first character following
the integer representation in 'string' is stored in 'endPos'.

If the value of 'base' is zero, the syntax expected is similar to that of integer constants,
which is formed by a succession of :
An optional sign character (+ or -)
An optional prefix indicating octal or hexadecimal base ("0" or "0x"/"0X" respectively)
A sequence of decimal digits (if no base prefix was specified) or either octal or hexadecimal digits if a specific prefix is present

If the 'base' value is between 2 and 36, the format expected for the integral number is a succession
of any of the valid digits and/or letters needed to represent integers of the specified radix
(starting from '0' and up to 'z'/'Z' for radix 36). The sequence may optionally be preceded by
a sign (either + or -) and, if base is 16, an optional "0x" or "0X" prefix.

If the first sequence of non-whitespace characters in 'string' is not a valid integral number
as defined above, or if no such sequence exists because either 'string' is empty or it contains
only whitespace characters, no conversion is performed.
strtolower native Converts all chars in string to lower case.
strtoupper native Converts all chars in string to upper case.
trim native Removes whitespace characters from the beginning and end of a string.
ucfirst native Make a string's first character uppercase.
vdformat native Formats a string according to the AMX Mod X format rules (see documentation).
vformat native Formats a string according to the AMX Mod X format rules (see documentation).