Skip to content

Modern String InsertAt

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › String Library › String Library › InsertAt

InsertAt

Inserts text at a position.

Syntax

InsertAt( s, insert, position )

Notes

  • O(n)

Examples

#import "std/strings"
using strings

print InsertAt( "1234567890", "--", 6 )    '' 12345--67890
print InsertAt( "12345", "--", 99 )        '' 12345-- -- past the end appends
print InsertAt( "12345", "--", 0 )         '' 12345 -- below 1 does not insert

'' The one-sided wrap Wrap deliberately does not do
print InsertAt( "value", "$", 1 )          '' $value

Library: String Library
Category: String Library
Documented under: The Functions

Clone this wiki locally