I have a RTF string and want to replace all occurnces of a substring with the content of another RTF string.
In that second RTF string I want to take out the general formatting code. So far no problem until there are several occurances of that part that I want to take out. It only replaces once! And no more… According to the documentation however it should replace all occurances
Do I do something wrong when I use:
string.replace(/\f(\d+)/, “”)
As said, the first replace works like a charm. The following occurances are NOT replaced…
Maybe this method would help you out as well:
(can be found in the utils tree of the method editor)
//Returns a string part with other part in a string
utils.stringReplace(‘these are test 1 and test 2.’,‘test’,‘cat’);//returns ‘these are cat 1 and cat 2.’
IT2BE:
In that second RTF string I want to take out the general formatting code. So far no problem until there are several occurances of that part that I want to take out. It only replaces once! And no more… According to the documentation however it should replace all occurances
Do I do something wrong when I use:
string.replace(/\f(\d+)/, “”)
As said, the first replace works like a charm. The following occurances are NOT replaced…