utf8.len | Multi Theft Auto: Wiki Skip to content

utf8.len

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


Returns the length of the string passed.

Syntax

utf8.len ( )

Code Examples

server

This example calculates the length of the input of the command /length and shows it in the chatbox.

addCommandHandler("length",
function (command, ...)
local input = table.concat({...}, " ")
if input then
local length = utf8.len( input )
outputChatBox( "* Length of your input: ".. length )
end
end
)

See Also