utfLen | Multi Theft Auto: Wiki Skip to content

utfLen

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

  • int: value

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

Code Examples

shared

This example adds a commandrussian_text_lengthwhich prints out a length russian text.

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