UtfLen

From Multi Theft Auto: Wiki
Revision as of 20:13, 7 March 2012 by Kenix1 (talk | contribs)
Jump to navigation Jump to search

The function gets the real length of a string, in characters.

Syntax

int utfLen  ( string theString )

Required Arguments

  • theString: The string to get the length of.

Returns

Returns an int if the function was successful, false otherwise.


Example

Click to collapse [-]
Client

This example adds a command russian_text_length which prints out a length russian text.

addCommandHandler( 'russian_text_length',
	function( )
		outputChatBox( string.format( 'Russian text length is %s', utfLen( 'Текст' ) ) )
	end
)

See Also