snaggs Posted November 22, 2011 Share Posted November 22, 2011 i am still pretty new at this.... i have a business card that has a middle initial followed by a period.. if (Field("MiddleInitial") == "") return ""; else return ToUpper(Field("MiddleInitial") +"."); how could i write this to include overriding whatever pucntuation the purchaser may add? any help is appreciated!! Link to comment Share on other sites More sharing options...
esmith Posted November 23, 2011 Share Posted November 23, 2011 if (Field("MiddleInitial") == "") return ""; else return ToUpper(Field("MiddleInitial")[color="red"].replace(/\W/g,"")[/color] +"."); The added replace method effectively removes any non alpha-numeric character. The "/\W/g" is a Regular Expression. Link to comment Share on other sites More sharing options...
snaggs Posted November 23, 2011 Author Share Posted November 23, 2011 Thanks, Eric...I appreciate your help and will make sure I save and remember this code! -Ricky Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.