# Request: $trim() scripting function

**URL:** https://community.mp3tag.de/t/request-trim-scripting-function/3134
**Category:** General Discussion
**Created:** [April 3, 2006, 6:25am UTC](https://community.mp3tag.de/t/request-trim-scripting-function/3134 "2006-04-03T06:25:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mugwump67](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mugwump67](https://community.mp3tag.de/u/mugwump67)
#### Post date: [April 3, 2006, 6:25am UTC](https://community.mp3tag.de/t/request-trim-scripting-function/3134/1 "2006-04-03T06:25:42Z")

</div>

Although I know there's a way to do it with the current scripting functions, it would be really nice to have a function $trim(string) that would remove leading/trailing blanks from the string. I have a number of improperly tagged files with fields containing 'foobar ' and it would be really nice to have a simple cript function that could use them. It is also useful if you are using the substring functions, which can result in leading/trailing blanks from time to time.

mp3tag is an amazing product. Keep up the good work!!!!

---

<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: [April 22, 2006, 8:11am UTC](https://community.mp3tag.de/t/request-trim-scripting-function/3134/2 "2006-04-22T08:11:31Z")

</div>

Added a $trim(x) functions to the latest [Development Build](http://developer.mp3tag.de). The optional second parameter specifies the character(s) to trim 🙂

---

<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: [April 27, 2022, 8:54am UTC](https://community.mp3tag.de/t/request-trim-scripting-function/3134/3 "2022-04-27T08:54:02Z")

</div>

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