Utf8.fold

From Multi Theft Auto: Wiki
Revision as of 02:29, 15 February 2016 by Necktrox (talk | contribs) (Created page with "__NOTOC__ {{Shared function}} Converts a UTF-8 string to folded case used to compare by ignore case. If ''input'' is an integer, it's treat as a code point and a convert code...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Converts a UTF-8 string to folded case used to compare by ignore case. If input is an integer, it's treat as a code point and a convert code point (number) is returned.

Syntax

string utf8.fold ( string|int input )

Required Arguments

  • input: A string character sequence OR an integer value

Returns

Returns a string in folded case.

Example

Click to collapse [-]
Server

This example shows how to convert a string to folded case, which can be used to compare with other folded strings.

local output = utf8.fold( "WHAT ARE YOU UP TO? Do you like uppercase?" )
print( output ) -- what are you up to? do you like uppercase?

local value = utf8.fold( 1088 )
print( type( value ) ) -- number

See Also