# By using String format method

**URL:** <https://forum.uipath.com/t/by-using-string-format-method/758901>\
**Category:** Studio\
**Tags:** activities-panel, question, studio\
**Created:** [August 8, 2024, 2:50pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901 "2024-08-08T14:50:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojmanu.rpa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/manojmanu.rpa/32/263143_2.png) [@manojmanu.rpa](https://forum.uipath.com/u/manojmanu.rpa)\
**Post date:** [August 8, 2024, 2:50pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/1 "2024-08-08T14:50:02Z")

</div>

Hi Team,

I have to write below string in string format method.

Input: Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160.

Output : Per TMCCC: Waived $39 on-site assessment. Not covered by QSP: Quoted $30/20min, additional time $22/32min; #160

Thanks,  
Manoj.

---

<div class="post-metadata">

**Author:** ![rlgandu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rlgandu/32/488436_2.png) [@rlgandu](https://forum.uipath.com/u/rlgandu)\
**Post date:** [August 8, 2024, 2:52pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/2 "2024-08-08T14:52:06Z")

</div>

@manojmanu.rpa

```auto
String.Format("Per TMCCC: Waived ${0} on-site assessment. Not covered by QSP: Quoted ${1}/{2}min, additional time ${3}/{4}min; #160", 39, 30, 20, 22, 32)

```

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/c/4/dc49caa82e0d44bacc9efc3996d4d3d9a6b62374.png)

---

<div class="post-metadata">

**Author:** ![vrdabberu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vrdabberu/32/484365_2.png) [@vrdabberu](https://forum.uipath.com/u/vrdabberu)\
**Post date:** [August 8, 2024, 3:10pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/3 "2024-08-08T15:10:21Z")

</div>

Hi @manojmanu.rpa

Save the values you want to replace in seperate variables like below

```auto
value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"

```

After that use the below syntax in Assign activity:

```auto
formattedString = String.Format("Per TMCCC: Waived ${0} on-site assessment. Not covered by QSP: Quoted ${1}/{2}min, additional time ${3}/{4}min; #160", value1, value2, value3, value4, value5)

```

Regards

---

<div class="post-metadata">

**Author:** ![manojmanu.rpa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/manojmanu.rpa/32/263143_2.png) [@manojmanu.rpa](https://forum.uipath.com/u/manojmanu.rpa)\
**Post date:** [August 8, 2024, 3:18pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/4 "2024-08-08T15:18:44Z")

</div>

Can we remove ’ symbol by using String format method?

---

<div class="post-metadata">

**Author:** ![vrdabberu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vrdabberu/32/484365_2.png) [@vrdabberu](https://forum.uipath.com/u/vrdabberu)\
**Post date:** [August 8, 2024, 3:34pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/5 "2024-08-08T15:34:46Z")

</div>

Hi @manojmanu.rpa

```auto
Input = "Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160."

Input = Input.Replace("‘","").Replace("’","").Replace("'","")

value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"

formattedString = String.Format(Input, value1, value2, value3, value4, value5)

```

Regards

---

<div class="post-metadata">

**Author:** ![vrdabberu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vrdabberu/32/484365_2.png) [@vrdabberu](https://forum.uipath.com/u/vrdabberu)\
**Post date:** [August 8, 2024, 3:40pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/6 "2024-08-08T15:40:47Z")

</div>

Check the below flow for better understanding @manojmanu.rpa

```auto
Input = "Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160."

Input = Input.Replace("‘","").Replace("’","").Replace("'","")

value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"

formattedString = String.Format(Input, value1, value2, value3, value4, value5)

```

 ![image](https://global.discourse-cdn.com/uipath/original/4X/9/1/9/9198f72a2547320274e628004eba3d138e60fd5f.png)

**FLOW:**

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/4/2/d42be159bbc0ed6c1962f13906b4d9a37b0f3525.png)

Regards

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [August 11, 2024, 3:40pm UTC](https://forum.uipath.com/t/by-using-string-format-method/758901/7 "2024-08-11T15:40:55Z")

</div>

Closed on August 11, 2024, 3:40pm UTC

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