LassoScript Utility
Basics Browse Detail

[String_Replace]

Tag Link [String_Replace] 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_Replace] takes three parameters: a string, a -Find keyword/value parameter, and a -Replace keyword/value parameter. Returns the string with the all instances of the -Find parameter replaced by the -Replace parameter. The find parameter is not case sensitive.

Syntax

[String_Replace: 'String Value',
  -Find='Pattern',
  -Replace='Pattern']

Parameters

Required Parameters
String Value The string which should be modified.
-Find The value which is to be found.
-Replace The value which is to replace each instance of the found parameter.
Optional Parameters
Encoding Keyword Specifies the encoding for the tag's return value. Tags are encoded using -EncodeHTML by default if their value is output on a format file. No encoding is applied to nested tags unless an explicity encoding keyword is specified. One of -EncodeBreak, -EncodeHTML, -EncodeNone, -EncodeRaw, -EncodeSmart, -EncodeStrictURL, -EncodeURL, -EncodeXML.

Examples

To replace a word within a string:

Use the [String_Replace] tag. The tag replaces the first instance of the found pattern within the string. The following example replaces the word Green with the word Blue.

[String_Replace: 'Green World', -Find='Green', -Replace='Blue']

Blue World

Related Tags

Category Tags