# Remove multiple leading and trailing space

**URL:** https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607
**Category:** Support
**Created:** [October 30, 2023, 9:19am UTC](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607 "2023-10-30T09:19:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![djgoosh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/8491ac/32.png) [@djgoosh](https://community.mp3tag.de/u/djgoosh)
#### Post date: [October 30, 2023, 9:19am UTC](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607/1 "2023-10-30T09:19:43Z")

</div>

Hi  
is there a function to remove space ?

for example  
"Beyonce "  
or  
" Beyonce"  
from artist/title

thanks

---

<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: [October 30, 2023, 9:31am UTC](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607/2 "2023-10-30T09:31:47Z")

</div>

You can create an [action](https://docs.mp3tag.de/actions/) around  
`$trim(x,c)`

From the [documentation](https://docs.mp3tag.de/scripting/#string-functions):

 ![image](https://community.mp3tag.de/uploads/default/original/2X/4/42c4b7bd61cbac49397bc55eef98e87f1b838bd0.png)

or you try one of the other FAQ entries:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/10):
>
> How to remove/trim leading and trailing spaces [Video tutorial for these actions](http://www.vimeo.com/7756545) Leading spaces: Action type: Replace with regular expressions Field: \_TAG Regular expression: ^\s+ Replace matches with: ^ matches the beginning of the string. Then \s+ searches for all whitespaces till a different char occurs. The whitespaces found will be replaced by nothing and, thus, deleted. Trailing spaces: Action type: Replace with regular expressions Field: \_TAG Regular expression: \s+$ Replace matc…

---

<div class="post-metadata">

### Author: ![djgoosh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/8491ac/32.png) [@djgoosh](https://community.mp3tag.de/u/djgoosh)
#### Post date: [October 30, 2023, 10:38am UTC](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607/3 "2023-10-30T10:38:12Z")

</div>

thank you very much for your help

---

<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 29, 2023, 10:39am UTC](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607/4 "2023-11-29T10:39:03Z")

</div>

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