# Remove Middle \[ \]

**URL:** <https://forum.uipath.com/t/remove-middle/172486>\
**Category:** Help\
**Tags:** data-manipulation, question, system, activities\
**Created:** [November 28, 2019, 12:53pm UTC](https://forum.uipath.com/t/remove-middle/172486 "2019-11-28T12:53:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shriharsha\_H\_N](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/shriharsha_h_n/32/113887_2.png) [@Shriharsha\_H\_N](https://forum.uipath.com/u/Shriharsha_H_N)\
**Post date:** [November 28, 2019, 12:53pm UTC](https://forum.uipath.com/t/remove-middle/172486/1 "2019-11-28T12:53:24Z")

</div>

Hello  
Below Line i need to remove only those **[]** in the middle any one can help

**Input :-**  
[WHO,WITHOUTACTMLOGO][CAT-CAT][SSLC,PQRG][SQL] 2D materialcode No.: [1504]" StandardQuantity=“1.500” SOM=“” SystmID=“1” AlternateMaterialSystemID=“” O

**Output:-**

[WHO,WITHOUTACTMLOGO][CAT-CAT][SSLC,PQRG][SQL] 2D materialcode No.: 1504" StandardQuantity=“1.500” SOM=“” SystmID=“1” AlternateMaterialSystemID=“” O

![image](https://global.discourse-cdn.com/uipath/original/3X/8/d/8d381ddcf329565aa787f2f3bd0e6c4cb916f95c.png)

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [November 28, 2019, 1:08pm UTC](https://forum.uipath.com/t/remove-middle/172486/2 "2019-11-28T13:08:31Z")

</div>

@Shriharsha_H_N,

Use string remove operation as like this,

```auto
strInput.Remove(strInput.LastIndexOf("["), 1)

```

---

<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:** [November 28, 2019, 1:18pm UTC](https://forum.uipath.com/t/remove-middle/172486/3 "2019-11-28T13:18:13Z")

</div>

Hi  
the expression is  
system.Text.RegularExpressions.Regex.Replace(str\_input,“[[\d]+]”,System.Text.RegularExpressions.Regex.Match(str\_input,“\w[\d]+\w\w”).ToString).ToString

where str\_input is the string varaible holding the string input  
and it worked

here you go with a xaml  
[sqrbrc.zip](https://forum.uipath.com/uploads/short-url/swvq3NKlUvTfOWhyC8tA0ytoISM.zip) (9.6 KB)  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/0/c/0ce3c7c7fbd88c5f7a805580d3bf5015c2a50ae1.png)

Cheers @Shriharsha_H_N
