1.2k questions
1.4k answers
361 comments
339 users
The StringUtils.replace() method only replaces string literals and does not accept regular expressions. The easiest way to do this it to convert the source value to a java string and use the String.replaceAll() method.
Here is an example:
var before = "1.25 fasting"; var after = (new java.lang.String(before)).replaceAll('[A-z ]', ''); qie.debug(before); qie.debug(after);
This will take the before string and replace any character between upper case A and lowercase z and any spaces with an empty string (basically removing the value).