# String manipulation1

**URL:** <https://forum.uipath.com/t/string-manipulation1/151321>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [September 17, 2019, 7:36am UTC](https://forum.uipath.com/t/string-manipulation1/151321 "2019-09-17T07:36:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samsanditha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/samsanditha/32/82940_2.png) [@Samsanditha](https://forum.uipath.com/u/Samsanditha)\
**Post date:** [September 17, 2019, 7:36am UTC](https://forum.uipath.com/t/string-manipulation1/151321/1 "2019-09-17T07:36:46Z")

</div>

i have string within data row as “ABB  
Company” and the required format is “ABB Company”…how can i achieve this..Kindly help

Thanks

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [September 17, 2019, 7:50am UTC](https://forum.uipath.com/t/string-manipulation1/151321/2 "2019-09-17T07:50:13Z")

</div>

@Samsanditha

System.Text.RegularExpressions.Regex.Replace(YourString,“[\n]”,“”)

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [September 17, 2019, 7:52am UTC](https://forum.uipath.com/t/string-manipulation1/151321/3 "2019-09-17T07:52:02Z")

</div>

Fine  
hope this expression would help you  
str\_input = “ABB  
Company”

then  
**str\_output = String.Join(" ",str\_input.Split(Environment.NewLine.ToArray()))**

Cheers @Samsanditha

---

<div class="post-metadata">

**Author:** ![qwerty1](https://avatars.discourse-cdn.com/v4/letter/q/ecc23a/32.png) [@qwerty1](https://forum.uipath.com/u/qwerty1)\
**Post date:** [September 17, 2019, 7:54am UTC](https://forum.uipath.com/t/string-manipulation1/151321/4 "2019-09-17T07:54:47Z")

</div>

If I’ve understood correctly, your data row has a carriage return between the first and the second word?

In this instance if your variable is named varName  
Use an ‘if’ statement with the condition varName.Contains(vbCr) or varName.Contains(vbLf)  
Within ‘Then’ use an Assign varName = varName.Replace(vbCr,“”)  
varName = varName.Replace(vbLr,“”)

Hope this helps

---

<div class="post-metadata">

**Author:** ![Samsanditha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/samsanditha/32/82940_2.png) [@Samsanditha](https://forum.uipath.com/u/Samsanditha)\
**Post date:** [September 17, 2019, 8:12am UTC](https://forum.uipath.com/t/string-manipulation1/151321/5 "2019-09-17T08:12:44Z")

</div>

> [@sandeep13](#):
>
> System.Text.RegularExpressions.Regex.Replace(YourString,“[\n]”,“”)

Thanks for the response…But i cudn’t get the required output

---

<div class="post-metadata">

**Author:** ![Samsanditha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/samsanditha/32/82940_2.png) [@Samsanditha](https://forum.uipath.com/u/Samsanditha)\
**Post date:** [September 17, 2019, 8:13am UTC](https://forum.uipath.com/t/string-manipulation1/151321/6 "2019-09-17T08:13:53Z")

</div>

Thank you…got the desired output

---

<div class="post-metadata">

**Author:** ![Samsanditha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/samsanditha/32/82940_2.png) [@Samsanditha](https://forum.uipath.com/u/Samsanditha)\
**Post date:** [September 17, 2019, 8:22am UTC](https://forum.uipath.com/t/string-manipulation1/151321/7 "2019-09-17T08:22:59Z")

</div>

Thanks for the response.when i tried this expression i got an error as vbLr is inaccessible

---

<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:** [September 20, 2019, 8:22am UTC](https://forum.uipath.com/t/string-manipulation1/151321/8 "2019-09-20T08:22:59Z")

</div>

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