You have the correct approach, but you used the wrong pattern. The return/new line combination should be specified as control characters not as their string representations. Also, the actual entry may be a combination of return and new line, not just one of these control characters. The correct function call would be
string.replace(input.my_string, "%c+", "").
The pattern "%c+" specifies 1 or more control characters.
There is an easy way to test your coding.
- Open an Expressor command window.
- Enter the command datascript to start the interactive command line interpreter.
- Use the square braces to demarcate your string; this allows you to define a string value that includes new lines. That is:
- Then try out your code.
my_string2 = string.replace(my_string,"%c+"," ")
- And print out the result