Utf8.title: Difference between revisions
Jump to navigation
Jump to search
m (swap with utf8.upper) |
m (add case folding note) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Shared function}} | {{Shared function}} | ||
{{Note|You may want to read up on [https://www.w3.org/International/wiki/Case_folding case folding]}} | |||
Converts a UTF-8 string to | Converts a UTF-8 string to title case (uppercase). If ''input'' is an integer, it is treated as a code point and a converted code point (number) is returned. | ||
==Syntax== | ==Syntax== | ||
Line 12: | Line 12: | ||
===Returns=== | ===Returns=== | ||
Returns a ''string'' in | Returns a ''string'' in uppercase. | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This example shows how to convert a string to | This example shows how to convert a string to uppercase. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local output = utf8.upper( "WHAT ARE YOU UP TO? Do you like uppercase?" ) | local output = utf8.upper( "WHAT ARE YOU UP TO? Do you like uppercase?" ) |
Revision as of 18:16, 15 February 2016
Note: You may want to read up on case folding |
Converts a UTF-8 string to title case (uppercase). If input is an integer, it is treated as a code point and a converted code point (number) is returned.
Syntax
string utf8.upper ( string|int input ) string utf8.title ( string|int input )
Required Arguments
- input: A string character sequence OR an integer value
Returns
Returns a string in uppercase.
Example
Click to collapse [-]
ClientThis 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
Shared
- utf8.byte
- utf8.char
- utf8.charpos
- utf8.escape
- utf8.find
- utf8.fold
- utf8.gmatch
- utf8.gsub
- utf8.insert
- utf8.len
- utf8.lower
- utf8.match
- utf8.ncasecmp
- utf8.next
- utf8.remove
- utf8.reverse
- utf8.sub
- utf8.title
- utf8.upper
- utf8.width
- utf8.widthindex