Description
This method replaces any words in a supplied string that match an entry in iCM's Swear Word Dictionary. By default they are replaced with a series of asterisks.
Parameters
Name | Type | Description |
---|---|---|
text | String, required | The text to perform the replacement on |
filterString | String, optional | The string that will be used in any substitutions |
Returns
Property | Type | Description |
---|---|---|
data | String | The text with substituted words |
Example
In this example the word "pumpkin" has been added to iCM's swear word dictionary, so is replaced by the supplied filter string.
Request
function(params, credentials) {
let resp = this.callWorkerMethod('formutils', 'filterswearwords', {
'text': 'words pumpkin words words words',
'filterString': 'REDACTED'
});
return resp;
}
Response
{
"id": 12,
"result": {
"data": "words REDACTED words words words",
"success": true
},
"jsonrpc": "2.0"
}
Last modified on August 01, 2023