How to add dashes to an SSN format?

I have a regex that gets the SSN (social security number from a from) - example output is


but some SSN has no dash like

123 44 5454

How do we automatically add dashes to SSN if the ssn number has no dashes ? Thanks,

Hi @AhmedKutraphali

Please try this

strText = “123 44 5454”

In assign

strText = strText.replace(" “,”-")


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.