koen
1
hi,
I need to replace the crlf in a json string but it doesn’t seem to work.
var textArea = Watch.GetJobInfo(8);
textArea.replace(/(?:\r\n|\r|\n)/g, ‘
’);
Watch.SetJobInfo(8, textArea);
Watch.Log("Jobinfo 8’s value is: " + Watch.GetJobInfo(8), 2);
Phil
2
You were close. Try this:
var textArea = Watch.GetJobInfo(8);
textArea = textArea.replace(/\r|\n/g, ‘’);
Watch.SetJobInfo(8, textArea);
or in more concise form:
Watch.SetJobInfo(8, Watch.GetJobInfo(8).replace(/\r|\n/g, ‘’));
koen
3
Thanks Phil, I also solved it and thought I deleted this topic