# Second, Third, ... Occurences Of String

**URL:** https://community.mp3tag.de/t/second-third-occurences-of-string/13990
**Category:** Support
**Created:** [October 12, 2012, 8:00pm UTC](https://community.mp3tag.de/t/second-third-occurences-of-string/13990 "2012-10-12T20:00:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 12, 2012, 8:00pm UTC](https://community.mp3tag.de/t/second-third-occurences-of-string/13990/1 "2012-10-12T20:00:07Z")

</div>

Hi people,

I know that:

**$strchr(x,y) Finds the first occurrence of character y in string x.  
$strrchr(x,y) Finds the last occurrence of character y in string x.  
$strstr(x,y) Finds the first occurrence of string y in string x.**

But is there anyway to return the second, third, and so on of **THE OCCURRENCES OF STRINGS** in a text??? I had been thinking of trimming all text before the first occurrence, and search the next one to find the second, and to trim the text until this, and search again to find the third, and so on...

But is there a way to do this directly???

Thanks

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 13, 2012, 2:02am UTC](https://community.mp3tag.de/t/second-third-occurences-of-string/13990/2 "2012-10-13T02:02:27Z")

</div>

> [@ykeyke](#):
>
> ... is there anyway to return the second, third, and so on of **THE OCCURRENCES OF STRINGS** in a text??? I had been thinking of trimming all text before the first occurrence, and search the next one to find the second, and to trim the text until this, and search again to find the third, and so on... But is there a way to do this directly??? Thanks

Beside the vehicle of the $meta functions ... Mp3tag has no itemlist related functions.

Read there ... about n-th occurence of substring in string ...  
[/t/13079/1](https://community.mp3tag.de/t/13079/1)

Other Example ...

Position 1.

**$cutLeft(%TF%,$strstr(%TF%,' - ')) $strstr(%TF%,$cutLeft(%TF%,$strstr(%TF%,' - ')))**

Position 2.

**$cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr($cutLeft(%TF%,$strstr(%TF%,' - ')),' - ')) $strstr(%TF%,$cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr($cutLeft(%TF%,$strstr(%TF%,' - ')),' - ')))**

Position 3.

**$cutLeft($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),$strstr($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),' - ')) $strstr(%TF%,$cutLeft($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),$strstr($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),' - ')))**

DD.20121013.0600.CEST

---

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 13, 2012, 8:58am UTC](https://community.mp3tag.de/t/second-third-occurences-of-string/13990/3 "2012-10-13T08:58:07Z")

</div>

> [@DetlevD](#):
>
> [/t/13079/1](https://community.mp3tag.de/t/13079/1)

Thanks DetlevD, as you mentioned in the topic above, the actions are the main strength of mp3Tag, even when there is no direct function to do something, you can find alternatives...

> [@DetlevD](#):
>
> Position 1.  
> $cutLeft(%TF%,$strstr(%TF%,' - '))  
> $strstr(%TF%,$cutLeft(%TF%,$strstr(%TF%,' - ')))
> 
> Position 2.  
> $cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr($cutLeft(%TF%,$strstr(%TF%,' - ')),' - '))  
> $strstr(%TF%,$cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr($cutLeft(%TF%,$strstr(%TF%,' - ')),' - ')))
> 
> Position 3.  
> $cutLeft($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),$strstr($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),' - '))  
> $strstr(%TF%,$cutLeft($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),$strstr($cutLeft($cutLeft(%TF%,$strstr(%TF%,' - ')),$strstr(%TF%,' - ')),' - ')))

Yes, that's it, it works fine...

Greetings

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/second-third-occurences-of-string/13990/4 "2026-02-09T12:24:06Z")

</div>


