Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macro Statements

Expression Editor

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Sorting objects

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: April 17, 2021
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

For

ForEach

If

Else If

Else

Switch

Case

Default

While

Expression

Comment

Break

Continue

Return

Hierarchy Objects

NotebookRoot

Notebook

SectionGroup

Section

Page

Page Objects

Title

Outline

Table

Column

Row

Cell

Paragraph

Text

Image

EmbeddedFile

Tag

Other Objects

DialogBox

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Object Functions

String Functions