Using a String Function to Remove Apostrophes from Usernames
Last Updated:
Overview
This article explains how to use a string function to return only alphabetical characters and remove apostrophes from a username.
Applies To
- Expression Language
- Custom Username Format
Solution
Follow the steps or video below:
To format a username like john.obrien@domain.com instead of john.o'brien@domain.com, use the following expression:
String.toLowerCase(user.firstName) + "." + String.toLowerCase(String.replace(user.lastName, "'", "")) + "@<domain>.com"
NOTE: Replace <domain> with the desired domain name.
