ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. utfSub

Function

utfSub

Server and clientUtilitiesIdentical to MTA:SA

Cuts a part of a text by character positions (from 1, both ends inclusive). Negative positions count from the end. Does not break non-ASCII letters, unlike string.sub.

Syntax

string utfSub(string theString [, int start = 1, int end = koniec])

Arguments

theStringstring
The text.
startint, optional = 1
First character.
endint, optional = koniec
Last character.

Returns

The text fragment.

Example

local nick = "Żaneta_Kowalska"
outputServerLog(utfSub(nick, 1, 6))

See also