# How to trim an empty line from a string

**URL:** <https://forum.alumio.com/t/how-to-trim-an-empty-line-from-a-string/791>\
**Category:** Mappers\
**Created:** [October 20, 2023, 8:14am UTC](https://forum.alumio.com/t/how-to-trim-an-empty-line-from-a-string/791 "2023-10-20T08:14:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Alumio\_Bot](https://forum.alumio.com/user_avatar/forum.alumio.com/alumio_bot/32/1824_2.png) [@Alumio\_Bot](https://forum.alumio.com/u/Alumio_Bot)\
**Post date:** [October 24, 2023, 1:48pm UTC](https://forum.alumio.com/t/how-to-trim-an-empty-line-from-a-string/791/4 "2023-10-24T13:48:17Z")

</div>

Did you find the ‘String: Trim characters’ mapper?  
Or was it not sufficient?

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/b/bf22457824851367720e343da125385889aba602.png)

Otherwise maybe a quick regex could’ve fixed it?

> [@How to replace everything from string with PCRE / REGEX result](https://forum.alumio.com/t/how-to-replace-everything-from-string-with-pcre-regex-result/155):
>
> It could happen you have a string and would like to replace everything except what you select with the PCRE / REGEX. For example we have the string: “/ProductImages/image-thumb\_\_14\_\_api\_product\_image/Roundball-1252789.1.png” And would like to remove everything except “Roundball-1252789.1.png”. Answer Your first thought might be to use the “String: PCRE replace” mapper with the following regex to select just the content behind the last forward slash: “([^/]+$)”. This will however not work w…

---

_[View the full topic](https://forum.alumio.com/t/how-to-trim-an-empty-line-from-a-string/791)._
