Project

General

Profile

$insert » History » Revision 2

Revision 1 (Per Amundsen, 08/06/2015 05:42 AM) → Revision 2/3 (Paul Janson, 03/25/2021 11:05 PM)

_Added in 1.8.10_ 

 *$insert(text, token, N)* 

 Insert token into text after at position N. 

 *Parameters* 

 text - Text to insert to. 
 token - Token to insert. 
 N - Position in text to insert the token after. at. 

 Resulting string has N characters of 'text', followed by 'token', followed by the remainder of 'text' 

 *Example* 

 <pre> 
 ; Insert 'wo' at position 6. 
 //echo -ag $insert(hello rld, wo, 6) 
 //var %string hello rld , %pos 6 , %new wo    | echo -ag $insert(%string, %new , %pos) same as $left(%string,%pos) $+ %new $+ $mid(%string,$calc(1+%pos)) 
 </pre>