# String manipulation

**URL:** <https://forum.knime.com/t/string-manipulation/79956>\
**Category:** KNIME Analytics Platform\
**Created:** [May 31, 2024, 11:46am UTC](https://forum.knime.com/t/string-manipulation/79956 "2024-05-31T11:46:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Data\_consumer](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Data\_consumer](https://forum.knime.com/u/Data_consumer)\
**Post date:** [May 31, 2024, 11:46am UTC](https://forum.knime.com/t/string-manipulation/79956/1 "2024-05-31T11:46:44Z")

</div>

Hi,  
I need to modify the following string by adding the column Date to the string.  
What is the easiest way to get this done? 🙂 Tried string manipulation, but was not able to get this to work 🙈

{ “fromdate”: “2000-01-01”, “todate”: “2030-12-31”,“asofdate”: $Date$,“datagroupings”: 4}

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [May 31, 2024, 11:57am UTC](https://forum.knime.com/t/string-manipulation/79956/2 "2024-05-31T11:57:51Z")

</div>

Hi @Data_consumer, so do you currently have the string in json format and you want to insert the value of $Date$ into it at the position shown, or are you trying to create the entire string from scratch?

---

<div class="post-metadata">

**Author:** ![Data\_consumer](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Data\_consumer](https://forum.knime.com/u/Data_consumer)\
**Post date:** [May 31, 2024, 11:59am UTC](https://forum.knime.com/t/string-manipulation/79956/3 "2024-05-31T11:59:58Z")

</div>

HI @Takbb!

I’m trying to create it from scratch… the $date$ is the only “data”, the rest is added (typed to string manipulation node) need the string for a post call body…

Thanks!

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [May 31, 2024, 12:16pm UTC](https://forum.knime.com/t/string-manipulation/79956/4 "2024-05-31T12:16:05Z")

</div>

Ok, the other question I should have asked: is the Date column actually a Date datatype or is it already a string in the required format?

- actually I don’t think it matters as if it is a Local Date column, the format you are producing yyyy-MM-dd is what will output anyway.

Try this:

```auto
join("{ \"fromdate\": \"2000-01-01\", \"todate\": \"2030-12-31\",\"asofdate\": \"",$Date$,"\",\"datagroupings\": 4}")

```

(every double quote within the string needs to be escaped as shown. Is that what was causing the problem?)

---

<div class="post-metadata">

**Author:** ![Data\_consumer](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Data\_consumer](https://forum.knime.com/u/Data_consumer)\
**Post date:** [May 31, 2024, 12:27pm UTC](https://forum.knime.com/t/string-manipulation/79956/5 "2024-05-31T12:27:08Z")

</div>

@takbb works like a charm! 🙂 The double quotes we the ones giving me the trouble, learned that one also now!

Thanks & enjoy the weekend!! 🙂

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [May 31, 2024, 12:31pm UTC](https://forum.knime.com/t/string-manipulation/79956/6 "2024-05-31T12:31:36Z")

</div>

Glad it worked for you @Data_consumer. Have a good weekend too.

And thanks for marking the solution. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 7, 2024, 12:32pm UTC](https://forum.knime.com/t/string-manipulation/79956/7 "2024-06-07T12:32:12Z")

</div>

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