String zu JSON, some problems with the string

Hello I try to form a string to a json and I need to replace some chars in the request.

The error seem to at this part:
from debug:

"rssi":"{WEB_MSG_STRONG}→9", (short version)
"rssi":"{WEB_MSG_STRONG}	9" (long version)

I already did this:

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

but the error remains.
Thanks 4 ur help

The indicates there is a tab character - \t in a regex.

msg.payload = msg.payload.replace(/\t/g,"")

worked! Thanks!

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