L3DT users' wiki
Large 3D terrain generator

strreplace

Description

Replace a substring of text within a string with another substring.

Function prototype

string strreplace <string:Text> <string:Old> <string:New>

Arguments

Name Type Comment
Text string A string, a substring of which is to be replaced.
Old string A substring of Text that is to be replaced.
New string A string that is to replace Old within Text.

Return value

A string containing Text with all instances of Old replaced by New.

Example

// replace "test" in "this is a test" with "awesome"

echo <strreplace "This is a test" "test" "awesome">

… the output of which is written to the event log by echo as:

This is awesome

Comments

None.

See also

 
plugins/general/zeoscript/reference/functions/strreplace.txt · Last modified: 2017/08/31 05:12 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki