# Remove trailing apostrophe

**URL:** https://community.mp3tag.de/t/remove-trailing-apostrophe/63625
**Category:** Support
**Created:** [January 31, 2024, 4:15am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625 "2024-01-31T04:15:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [January 31, 2024, 4:15am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/1 "2024-01-31T04:15:26Z")

</div>

How can we do the same thing but with a single trailing apostrophe?

So Cryin' becomes Cryin

I've tried a few variations but it seems to ignore my wishes. I'm obviously guessing wrong.

---

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [January 31, 2024, 4:56am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/2 "2024-01-31T04:56:40Z")

</div>

Turns out you need to use ASCII codes and a line break....  
The following removes ONLY ALL trailing apostrophes at the end the string, so you will lose your '' if you have a double apostrophe to indicate 7 inch or 12 inch at the end of your TITLE. (i.e 7'' or 12'' - where '' is a double apostrophe (char(39) and not a double quote (char(34) will remove both apostrophes)

[#187]  
T=5  
1=$trimRight(%TITLE%,$char(39)$char(10))  
F=TITLE

---

<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: [January 31, 2024, 6:40am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/3 "2024-01-31T06:40:00Z")

</div>

I am not convinced that a $char(10) can always be found in a string.

If you want to get rid or really only the apostrophes at the end of the TITLE, try an action of the type "Format value" or Convert\>Tag-Tag for TITLE and  
Format string: `$regexp(%title%,''$,)`

The double apostrophe in the expression escapes the apostrophe which otherwise has a special function in the regular expression.

If, on the other hand you only want to remove the trailing apostrophes in the text but keep the ones at the end of a field, try:  
Format string: `$regexp(%title%,''\s+,)`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [January 31, 2024, 9:36am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/5 "2024-01-31T09:36:28Z")

</div>

The only way I have found is to use several single steps.  
Something like  
replace the 2 single apostrophes `''` as inches indicator with a rare used character like `§` or `°`  
and - after the next unsolved step - "undo" it and replace the rare character back to 2 single apostrophes.

The unsolved step is this:  
How to replace the remaining single apostrophes with nothing = delete them?  
**Because here we have a problem:**  
How do you distinguish between an single UNWANTED apostrophe in  
`So Cryin' becomes Cryin`  
and a WANTED single apostrophe in  
`So O'Reilly remains O'Reilly`  
Maybe if you try to replace only a single apostrophe followed by a space?  
This will not work for a single apostrophe at the end of line like in  
`So at the end you have still Cryin'`  
This also not works for (theoretically existing) apostrophes at the start of a word or at start of the line like  
`'nuff said and the Klingon's still think there are 's`

Currently, I don't see a reliable way to achieve a solution for most of the occurences.

Any other ideas?

---

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [February 2, 2024, 2:23am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/6 "2024-02-02T02:23:10Z")

</div>

With my expression/s above, it does not remove apostrophes in the middle of words, so O'Reilly is safe. I tested it and it doesn't usually remove any at all in the middle, unless I think there was a thing where  
Cryin' (Remix) ==\> Cryin (Remix) but that could have been from other code I have in the same Action/

But otherwise the one's in the middle of the string survived

---

<div class="post-metadata">

### Author: ![djrip](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@djrip](https://community.mp3tag.de/u/djrip)
#### Post date: [February 2, 2024, 2:25am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/7 "2024-02-02T02:25:35Z")

</div>

If my code becomes an issue, I shall try this. Thanks

---

<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: [November 10, 2025, 6:04am UTC](https://community.mp3tag.de/t/remove-trailing-apostrophe/63625/8 "2025-11-10T06:04:14Z")

</div>

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