suve

awful: function: str-ins

Declaration

ascii :str-pos ( ascii $ORIG , string $NEEDLE , int $INDEX )
utf8 :str-pos ( utf8 $ORIG , string $NEEDLE , int $INDEX )

Summary

Returns a string composed of ORIG with NEEDLE inserted before the INDEXth character or codepoint.
Type of returned string is based on the type of ORIG.

Example

# :str-ins example
:set &str s'awful is hard!'
:set &str :str-ins $str s' not' i9
:writeln $str

wikistrona zmodyfikowana 2014/0601/2317