Loading

REPLACE


strings
Since v1.1.0
Available on all platforms
See also

Replaces the first occurrence of a pattern by its substitution.

The REPLACE consumes 3 parameters from the stack:

  • the replacement value
  • the pattern to search, could be a regular expression
  • the input value

All parameters are converted into strings via the toString() method before the replacement is done.

Signature

Examples

'This is false' // input false // pattern true // replacement REPLACE 'This is false' // input '(fa..e)' // regexp pattern true // replacement REPLACE 'The Warp 42 Platform is designed to collect, store and manipulate sensor data.' // input 42 // pattern 10 // replacement REPLACE