LassoScript Utility
Basics Browse Detail

[String_Insert]

Tag Link [String_Insert] Category String
Type Substitution Source Available No
Support Preferred Version 2.5
Change Unchanged Data Source Any
Output Type String Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x, Lasso 2.5

Description

[String_Insert] takes three parameters: a string, a -Text keyword/value parameter which defines the text to be inserted, and a -Position parameter which defines the offset into the string at which to insert the text. Returns a new string with the specified text inserted at the specified location.

Syntax

[String_Insert: 'String Value',
  -Position=Position,
  -Text='String Value']

Parameters

Required Parameters
String Value The string value which is to be modified.
-Text The value to be inserted into the string.
-Position The offset into the string at which to insert the text.

Change Notes

[String_Insert] now inserts at the specified index, not after the specified index. This is a change over how this tag worked in LDML5 and LDML6.

Examples

To insert a string into another string:

Use the [String_Insert] tag. The following example inserts the word quick into the string in between the first two words.

[String_Insert: 'The brown fox jumped over the lazy dog',
  -Position=5, -Text='quick ']

The quick brown fox jumped over the lazy dog.

Related Tags

Category Tags