In this Page
...
Description | Returns a new string with some or all matches of a pattern replaced by another. The replacement can be a string or a function that is called for each match. If the first argument is a regular expression, the method will replace all matches if the global flag is set (e.g. /test/g). If the global flag is not set or the first argument is a string, only the first match will be replaced. If the replacement is a function, its result will be used as the replacement for a given match. The function will be passed the following parameters:
This is similar to the JavaScript replace. | ||
---|---|---|---|
Syntax |
| ||
Example |
|
...
Description | Returns a new string with text extracted from another string. If beginIndex is greater than or equal to the length of the string, an empty string is returned. If it is negative, it returns that many characters from the end of the string length. If This is similar to the JavaScript slice. | ||
---|---|---|---|
Syntax |
| ||
Example | Where $String contains "Copyright 2017 All rights reserved." Expression: $String.slice(10) Result: 2017 All rights reserved. Expression: $String.slice(10,14) Result: 2017 Expression: $String.slice(10,-2) Result: 2017 All rights reserve Expression: $String.slice(-2) Result: d. |
...