# String zu JSON, some problems with the string

**URL:** <https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617>\
**Category:** General\
**Created:** [31 March 2022 19:51 UTC](https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617 "2022-03-31T19:51:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hohmannc](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hohmannc](https://discourse.nodered.org/u/hohmannc)\
**Post date:** [31 March 2022 19:51 UTC](https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617/1 "2022-03-31T19:51:43Z")

</div>

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:

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

```

I already did this:

```auto
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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [31 March 2022 19:55 UTC](https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617/2 "2022-03-31T19:55:11Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![hohmannc](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hohmannc](https://discourse.nodered.org/u/hohmannc)\
**Post date:** [31 March 2022 20:47 UTC](https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617/3 "2022-03-31T20:47:11Z")

</div>

worked! Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 May 2022 20:47 UTC](https://discourse.nodered.org/t/string-zu-json-some-problems-with-the-string/60617/4 "2022-05-30T20:47:13Z")

</div>

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