UtfSeek: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{Needs_Example}}
The function returns the byte position at specified character position.
The function returns the byte position at specified character position.


Line 11: Line 10:
===Required Arguments===
===Required Arguments===
*'''theString:''' The [[string]].
*'''theString:''' The [[string]].
*'''position:''' An [[int]] with the specified charachter position.
*'''position:''' An [[int]] with the specified character position.


===Returns===
===Returns===
Line 19: Line 18:
<section name="Example" class="both" show="true">
<section name="Example" class="both" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local string = "Hello World"
local teststring = "Hello World"
local seek = utfSeek ( string, 5 )
local testseek = utfSeek ( teststring, 5 )
outputChatBox ( seek )
outputChatBox ( testseek )
</syntaxhighlight></section>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Utility_functions}}
{{Utility_functions}}

Latest revision as of 10:42, 21 May 2023

The function returns the byte position at specified character position.

Syntax

int utfSeek ( string theString, int position )

Required Arguments

  • theString: The string.
  • position: An int with the specified character position.

Returns

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

Example

Click to collapse [-]
Example
local teststring = "Hello World"
local testseek = utfSeek ( teststring, 5 )
outputChatBox ( testseek )

See Also