Remove all empty spaces at the end of the text

1232
2
02-06-2019 05:40 AM
OussamaMerhi
Occasional Contributor

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
2 Replies
NickDierks1
Frequent Contributor

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

WindsorConnecticut
Occasional Contributor

       

0 Kudos