# \[X\] Bug in Tag/Tag conversion?

**URL:** <https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397>\
**Category:** No Bugs\
**Created:** [November 24, 2015, 5:58am UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397 "2015-11-24T05:58:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maestro3](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@maestro3](https://community.mp3tag.de/u/maestro3)\
**Post date:** [November 24, 2015, 5:58am UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397/1 "2015-11-24T05:58:15Z")

</div>

If you have a tag string (without quotes) say "Curl / Any Title" the function

$left(%d%, $strchr(%d%, "/"))

returns "Curl " correctly.

If you have a tag string say "Hans Christian / Any Title" the same function returns just "Hans" it returns at the first whitespace.

Is this intended?

Regards

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [November 24, 2015, 6:56am UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397/2 "2015-11-24T06:56:22Z")

</div>

Definitely not a bug!

The double quotes cause the function to ignore the forward slash.  
Instead, $strchr is returning the position of the first white-space, because that is the character following the comma.  
Try this: $trim($left(%comment%,$sub($strchr(%comment%,/),1)))  
(I don't know what %d% is so I used %comment% for an example)

---

<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:** [November 24, 2015, 10:24am UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397/3 "2015-11-24T10:24:09Z")

</div>

> [@maestro3](#):
>
> If you have a tag string (without quotes) say "Curl / Any Title" the function $left(%d%, $strchr(%d%, "/")) returns "Curl " correctly. If you have a tag string say "Hans Christian / Any Title" the same function returns just "Hans" it returns at the first whitespace. Is this intended? Regards

**$left('Hans Christian / Any Title',$sub($strstr('Hans Christian / Any Title',' / '),1)) ==\> 'Hans Christian' ... or using a tag-field ... $left(%TITLE%,$sub($strstr(%TITLE%,' / '),1)) ... or ... $regexp(%TITLE%,'^(.+?) / (.+?)$','$1')**

DD.20151124.1224.CET

---

<div class="post-metadata">

**Author:** ![maestro3](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@maestro3](https://community.mp3tag.de/u/maestro3)\
**Post date:** [November 25, 2015, 5:36am UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397/4 "2015-11-25T05:36:34Z")

</div>

Thanks for the prompt reply. The quotes happen when one has a "programmer" background....

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [December 28, 2018, 2:37pm UTC](https://community.mp3tag.de/t/x-bug-in-tag-tag-conversion/17397/5 "2018-12-28T14:37:29Z")

</div>

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