# 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:** 1
**Showing post:** 2

<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…

---

_[View the full topic](https://community.mp3tag.de/t/remove-multiple-leading-and-trailing-space/62607)._
