utf8.ncasecmp
Client-side
Server-side
Shared
Needs checking
This function was partially migrated from the old wiki. Please review manually:
- Missing section: Indicators
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
Compares two strings in lower-case and returns the difference indicator (see table below) as an integer value.
Syntax
int utf8.ncasecmp utf8.ncasecmp ( string a, string b )Required Arguments
- a: A string character sequence
- b: A string character sequence
Returns
- int utf8.ncasecmp: value
Returns an integer , which indicates the difference, see the table below for further information.
Code Examples
shared
This example shows a simple comparsion of two different strings.
local a = "Hello"local b = "World"local result = utf8.ncasecmp( a, b )
if result == -1 then print( "a < b" ) -- printedelseif result == 0 then print( "a == b" )elseif result == 1 then print( "a > b" )end