Remove all empty spaces at the end of the text

957
1
02-06-2019 05:40 AM
OussamaMerhi
New Contributor II

Hi,

I would like to remove all empty spaces at the end of the text. trim function is not working in survey123. Is there any way to remove the empty spaces from the end of text in survey123?

Best,

Oussama

0 Kudos
1 Reply
NickDierks1
Occasional Contributor II

It's no trim, but you could try adding a constraint to prevent survey responses from being submitted with trailing whitespace: not(regex(., '\s$'))

The $ within the expression specifically looks for matches at the end of the string. The \s matches any whitespace, including spaces, tabs, and carriage returns (in case you're using this in a multiline text field).

Quick Reference: Regular Expressions