Trimming a String

Hello Experts,   I am getting a date as a string via a REST call. I need to trim the formatting to remove the +0000 at the end. What is the best approach to achieve this? Thank you  
2 answers

If you just want the string, try something like:

replaceAll($yourStringVariable, '\+0000$', '')

or if you want to trim any time offset after the plus:

replaceAll($yourStringVariable, '\+\d{4}$', '')

or if you want to get a datetime variable out of the string, try parseDateTime or parseDateTimeUTC and then display however you want using formatDateTime

parseDateTime($yourStringVariable, 'EEE, d MMM yyyy HH:mm:ss Z')


Hi Joe,


You can use the following string manipulation if it suits your requirements:

substring($Date, 0,findLast($Date, '+'))


This function with find the last ‘+’ in your string and then return the subtring before that.


You can read more about String functions here: String Function Calls | Mendix Documentation


Hope this helps.