SecureString.replaceString(options)
Method Description |
Replaces all occurrences of a pattern string inside an https.SecureString with a replacement string.
Tip:
If you are using an https.SecureString as a URL in https.put(options) or https.post(options) calls, you can use this method to escape any special characters you are using in the URL. For instance, you can replace the ‘#’ special character with ‘%23’ to allow for the use of ‘#’ in a SecureString used as a URL. |
Returns |
A converted https.SecureString (not a new SecureString). |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2021.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The string to be replaced. |
|
string |
required |
The replacement string. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.
// Add additional code
...
var secureString1 = https.createSecureString({
input: "myFirstSecureString"
});
var originalString = "First";
var newString = "Only"
secureString1.replaceString({
pattern: originalString,
replacement: newString
});
...
// Add additional code