Difference between revisions of "Utf8.insert"

From GiderosMobile
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2016.06<br/>
'''<translate>Available since</translate>:''' Gideros 2016.06<br/>
+
'''Class:''' [[utf8]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/utf8|utf8]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Insert a substring to s. If idx is given, insert substring before char at this index, otherwise substring will concat to s. idx can be negative.</translate>
+
Inserts a substring to '''s'''.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = utf8.insert(s,idx,substring)
 
(string) = utf8.insert(s,idx,substring)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''s''': (string) <translate></translate> <br/>
+
If ''idx'' is given, insert substring before char at this index, otherwise substring will concat to s. ''idx'' can be negative.
'''idx''': (number) <translate>index where to insert</translate> '''optional'''<br/>
+
 
'''substring''': (string) <translate></translate> '''optional'''<br/>
+
=== Parameters ===
=== <translate>Return values</translate> ===
+
'''s''': (string) <br/>
'''<translate>Returns</translate>''' (string) <translate>new string</translate><br/>
+
'''idx''': (number) index where to insert '''optional'''<br/>
 +
'''substring''': (string) '''optional'''<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (string) new string<br/>
 +
 
 +
{{Utf8}}

Latest revision as of 21:58, 1 December 2023

Available since: Gideros 2016.06
Class: utf8

Description

Inserts a substring to s.

(string) = utf8.insert(s,idx,substring)

If idx is given, insert substring before char at this index, otherwise substring will concat to s. idx can be negative.

Parameters

s: (string)
idx: (number) index where to insert optional
substring: (string) optional

Return values

Returns (string) new string