Utf8.insert: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2016.06<br/> === Description === Insert a substring to s. If idx is given, insert substring before char at this index, otherwise subst..."
 
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2016.06<br/>
'''Available since:''' Gideros 2016.06<br/>
'''Class:''' [[utf8]]<br/>
=== Description ===
=== Description ===
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.
Inserts a substring to '''s'''.
<source lang="lua">
<syntaxhighlight lang="lua">
(string), = utf8.insert(sidxsubstring,)
(string) = utf8.insert(s,idx,substring)
</source>
</syntaxhighlight>
'''s:''' (string) ''''''<br/>
 
'''idx:''' (number) index where to insert '''optional'''<br/>
If ''idx'' is given, insert substring before char at this index, otherwise substring will concat to s. ''idx'' can be negative.
'''substring:''' (string) '''optional'''<br/>
 
=== Parameters ===
'''s''': (string) <br/>
'''idx''': (number) index where to insert '''optional'''<br/>
'''substring''': (string) '''optional'''<br/>
 
=== Return values ===
'''Returns''' (string) new string<br/>
'''Returns''' (string) new string<br/>
{{Utf8}}

Latest revision as of 20: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