Utf8.title: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Redirected page to Utf8.upper)
 
m (Split syntax into different boxes)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[Utf8.upper]]
__NOTOC__
{{Shared function}}
{{Note|You may want to read up on [https://www.w3.org/International/wiki/Case_folding case folding] for more information about the use of this function.}}
Converts a UTF-8 string to title case (uppercase). If ''input'' is an integer, it is treated as a codepoint and a converted codepoint (integer) is returned.
 
==Syntax==
<syntaxhighlight lang="lua">
string utf8.title ( string|int input )
</syntaxhighlight>
<syntaxhighlight lang="lua">
string utf8.upper ( string|int input )
</syntaxhighlight>
 
===Required Arguments===
*'''input:''' A string character sequence OR an integer value
 
===Returns===
Returns a ''string'' in uppercase OR returns an ''integer'' (see description).
 
==Example==
<section name="Client" class="client" show="true">
This example shows how to convert a string to uppercase.
<syntaxhighlight lang="lua">
local output = utf8.upper( "WHAT ARE YOU UP TO? Do you like uppercase?" )
outputConsole( output ) -- WHAT ARE YOU UP TO? DO YOU LIKE UPPERCASE?
 
local value = utf8.title( 1088 )
outputConsole( value, type( value ) ) -- 1056, number
</syntaxhighlight>
</section>
 
==See Also==
{{UTF8 functions}}

Latest revision as of 13:12, 30 April 2021

[[{{{image}}}|link=|]] Note: You may want to read up on case folding for more information about the use of this function.

Converts a UTF-8 string to title case (uppercase). If input is an integer, it is treated as a codepoint and a converted codepoint (integer) is returned.

Syntax

string utf8.title ( string|int input )
string utf8.upper ( string|int input )

Required Arguments

  • input: A string character sequence OR an integer value

Returns

Returns a string in uppercase OR returns an integer (see description).

Example

Click to collapse [-]
Client

This example shows how to convert a string to uppercase.

local output = utf8.upper( "WHAT ARE YOU UP TO? Do you like uppercase?" )
outputConsole( output ) -- WHAT ARE YOU UP TO? DO YOU LIKE UPPERCASE?

local value = utf8.title( 1088 )
outputConsole( value, type( value ) ) -- 1056, number

See Also