# How to replace string

**URL:** <https://forum.uipath.com/t/how-to-replace-string/8709>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [July 26, 2017, 2:56pm UTC](https://forum.uipath.com/t/how-to-replace-string/8709 "2017-07-26T14:56:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Sahu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/saurabh_sahu/32/3707_2.png) [@Saurabh\_Sahu](https://forum.uipath.com/u/Saurabh_Sahu)\
**Post date:** [July 26, 2017, 2:56pm UTC](https://forum.uipath.com/t/how-to-replace-string/8709/1 "2017-07-26T14:56:55Z")

</div>

I want to remove a string i.e. **[View Hierarchy**] from string **clientName[View Hierarchy].**

Means I want only string **clientName** and **[View Hierarchy]** should be removed from last.

Also there should not be any space or character in Main string when we remove it.

Actual output should be- **clientName**

---

<div class="post-metadata">

**Author:** ![acaciomelo](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/acaciomelo/32/32180_2.png) [@acaciomelo](https://forum.uipath.com/u/acaciomelo)\
**Post date:** [July 26, 2017, 3:00pm UTC](https://forum.uipath.com/t/how-to-replace-string/8709/2 "2017-07-26T15:00:27Z")

</div>

Hi @Saurabh_Sahu,

Kindly check the example attached. It basically removes everything after the “[” character and it doesn’t matter how many characters are after that, it will remove them.

[Main.xaml](https://global.discourse-cdn.com/uipath/original/2X/2/28d0e882c1b683f1cb61edfd5f33ffd75f4ba462.xaml) (6.0 KB)

---

<div class="post-metadata">

**Author:** ![Saurabh\_Sahu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/saurabh_sahu/32/3707_2.png) [@Saurabh\_Sahu](https://forum.uipath.com/u/Saurabh_Sahu)\
**Post date:** [July 26, 2017, 3:15pm UTC](https://forum.uipath.com/t/how-to-replace-string/8709/3 "2017-07-26T15:15:05Z")

</div>

@acaciomelo Whoaaa,Thanks mate, it worked for me!!

---

<div class="post-metadata">

**Author:** ![AKY](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aky/32/16563_2.png) [@AKY](https://forum.uipath.com/u/AKY)\
**Post date:** [January 15, 2018, 6:35am UTC](https://forum.uipath.com/t/how-to-replace-string/8709/4 "2018-01-15T06:35:14Z")

</div>

Hi, I have a issue with replace character same.  
How to replace quote " character. Thanks
