
JordanJ.26599 (Customer) asked a question.
I have a service provider SSO integration that is requiring the phone number attribute come through the assertion in format XXX-XXX-XXXX. Currently, Active Directory is our Profile Master and the format is country code, then 10 digit phone number, like +15555555555. We need to create an attribute for this SP that takes the phone number and changes it to the support format like 555-555-5555 (no + and no country code, add hyphens). So far I have this which works to remove the + and the country code-
String.replace(user.primaryPhone, "+1","")
Anyone have any suggestion on how to add the hyphens as expected?

Well I played around enough and found something that will work for me. Here it is if anyone else comes across this same sort of question-
String.substring(user.primaryPhone, 2, 5)+"-" + String.substring(user.primaryPhone, 5, 8)+"-" + String.substring(user.primaryPhone, 8, 12)
Since my AD format is +155555555555, instead of removing the +1 for country code, I just only read in the characters I want and break them apart by adding hyphens between. I'm sure there are better ways and I'm all ears but this will work for me.