Replace(), ReplaceAll()

NoteOnly available in the preprocessor!

Find and replace a String with another string.

Syntax

  • Replace(source as string, find as string, replacement as string)
    Replaces the first occurrence of a string with another string.
  • ReplaceAll(source as string, find as string, replacement as string)
    Replaces all occurrences of a string with another string.

Example

result=Replace("Hello world! Good morning world!","world","earth") ;returns "Hello earth! Good morning world!"
result=ReplaceAll("Hello world! Good morning world!","world","earth") ;returns "Hello earth! Good morning earth!"