Remove space string node red


I receive a payload a string, I have arrows I can't format the code in JSON
I tried with that

msg.payload = msg.payload.replace(/\n/g," ");
return msg;

it does not work


Those arrows are tab characters \t not \n

1 Like

Oh, Perfect ^^. Impeccable.
I would like to collect only the numbers.

But I can't use the payload ...

In that case split the string on the tab characters and take the second element. JavaScript String split() Method

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.