# Help with Strchr function

**URL:** https://community.mp3tag.de/t/help-with-strchr-function/18737
**Category:** General Discussion
**Created:** [February 22, 2017, 9:47am UTC](https://community.mp3tag.de/t/help-with-strchr-function/18737 "2017-02-22T09:47:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mp3useranet](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mp3useranet](https://community.mp3tag.de/u/mp3useranet)
#### Post date: [February 22, 2017, 9:47am UTC](https://community.mp3tag.de/t/help-with-strchr-function/18737/1 "2017-02-22T09:47:08Z")

</div>

Hi,  
I am using Strchr function extensively.  
I normally use it with other scripting functions to remove portion of text from title of the song.  
For example I use following to remove any text/characters in 'title' tag beyond '-'.

$left(%title%,$add($strchr(%title%,-),-2))

So my title would become from abc - xyz to abc.

But if my title is like this abc (xyz) then I CAN NOT use the same scripting function as below  
$left(%title%,$add($strchr(%title%,(),-2))

It gives me error. so I can not use ( (left bracket) as the separating character.  
Any workaround to this?

Thanks for reading.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 22, 2017, 9:51am UTC](https://community.mp3tag.de/t/help-with-strchr-function/18737/2 "2017-02-22T09:51:19Z")

</div>

> [@Anet](#):
>
> ...  
> $left(%title%,$add($strchr(%title%,(),-2))  
> ...

$left(%title%,$add($strchr(%title%,'('),-2))

Just out of curiosity: isn't adding -2 something for $sub()  
$left(%title%,$sub($strchr(%title%,'('),2))
