Skip to content

utfLen

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

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

  • int: value

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
)