Dear team
How can I write the logic to check the space in a string field. For example if name of a person is John Deli, the enumerators must write the first name and last name like John<space> Deli, not JohnDeli with min length 5.
Thank you.
Regards,
Brti
Check length of text with space
Forum rules
New release: CSPro 8.0
New release: CSPro 8.0
-
- Posts: 1777
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Check length of text with space
There are a variety of ways you could do this, but one option is to use the regexmatch function: https://www.csprousers.org/help/CSPro/r ... ction.html
If you want to check for characters, a single space, more characters, and then optional spaces, you would use this regular expression: ^\S+\s\S+\s*$
You can test it here: https://regex101.com/r/wjkOp8/1
If you want to check for characters, a single space, more characters, and then optional spaces, you would use this regular expression: ^\S+\s\S+\s*$
You can test it here: https://regex101.com/r/wjkOp8/1