Utf8.fold: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Redirected page to Utf8.lower)
m (swap with utf8.lower)
Line 1: Line 1:
#REDIRECT [[Utf8.lower]]
__NOTOC__
{{Shared function}}
 
Converts a UTF-8 string to lower-case, which can be used to compare two strings. If ''input'' is an integer, it's treat as a code point and a convert code point (number) is returned.
 
==Syntax==
<syntaxhighlight lang="lua">string utf8.lower ( string|int input )
string utf8.fold ( string|int input )</syntaxhighlight>
 
===Required Arguments===
*'''input:''' A string character sequence OR an integer value
 
===Returns===
Returns a ''string'' in lower-case.
 
==Example==
<section name="Server" class="server" show="true">
This example shows how to convert a string to lower-case, which can be used to compare with other folded strings.
<syntaxhighlight lang="lua">
local output = utf8.lower( "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
</syntaxhighlight>
</section>
 
==See Also==
{{UTF8 functions}}

Revision as of 18:10, 15 February 2016

Converts a UTF-8 string to lower-case, which can be used to compare two strings. If input is an integer, it's treat as a code point and a convert code point (number) is returned.

Syntax

string utf8.lower ( string|int input )
string utf8.fold ( string|int input )

Required Arguments

  • input: A string character sequence OR an integer value

Returns

Returns a string in lower-case.

Example

Click to collapse [-]
Server

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

local output = utf8.lower( "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

Shared