strcmp
strcmp(t_string1t_string2) => 1 / 0 / -1
Description
Compares two argument strings alphabetically.
Compares the two argument strings t_string1 and t_string2 and returns an integer greater than, equal to, or less than zero depending on whether t_string1 is alphabetically greater, equal to, or less than t_string2. To test if the contents of two strings are the same, use the equal function.
Arguments
Value Returned
Examples
strcmp( "abc" "abb" )
=> 1
strcmp( "abc" "abc")
=> 0
strcmp( "abc" "abd")
=> -1
Related Topics
Return to top