Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > String Functions > String_Insert

String_Insert

Inserts a string into another string at a specified position and returns the resulting string.

Syntax

String String_Insert(
	String string, 
	String other, 
	Numeric offset)

Parameters

String string
String to insert into.
String other
String to insert.
Numeric offset
Offset to insert at. If non-negative, the string will be inserted at this number of characters counted from the beginning of the string. If negative, the string will be inserted at this number of characters counted from the end of the string.

Examples

$string = "the quick brown fox " $insert = "JUMPED" // Insert at the beginning String_Insert($string, $insert, 0) // "JUMPEDthe quick brown fox " // Insert at the end String_Insert($string, $insert, String_Length($string)) // "the quick brown fox JUMPED" // Insert at index 7 String_Insert($string, $insert, 7) // "the quiJUMPEDck brown fox " // Insert at 5th character from the end String_Insert($string, $insert, -5) // "the quick brownJUMPED fox "

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions