traba5058 Posted July 28, 2016 Share Posted July 28, 2016 I'm working on a business card that has 1 street address field. I need to change the case to uppercase & superscript the street name when it is a number. Ex: North 44th Street should change to NORTH 44TH STREET and the th in 44th needs to superscript. Is there a way to do this with javascript or is my only option to create formatted text resources? Quote Link to comment Share on other sites More sharing options...
step Posted July 28, 2016 Share Posted July 28, 2016 Use the "ToUpper" function to convert the address to uppercase. Then use a regex similar the the one below to replace any digit followed by "ST", "TH", "RD", or "ND" with the matched digit and the superscripted matched letters. return ToUpper(Field('Street')).replace(/(\d)(ST|TH|RD|ND)/g, '$1<superscript>$2</superscript>'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.