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

utf8.sub

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 a substring of the string passed. The substring starts at i. If the third argument j is not given, the substring will end at the end of the string. If the third argument is given, the substring ends at and includes j.

Syntax

utf8.sub ( )

Code Examples

server

This example shows how to extract a substring from a UTF-8 string.

local input = "Yarın Salı"
local output = utf8.sub( input, 1, 4 )
outputConsole( output ) -- Yarı
local output = utf8.sub( input, -4 )
outputConsole( output ) -- Salı
local output = utf8.sub( input, -4, -1 )
outputConsole( output ) -- Salı

See Also