Tony Olivas Posted January 23, 2012 Share Posted January 23, 2012 Hello all, I'm looking for Script that deals with a first name that ends with an S. I want to add just an apostrophe if the name ends with S. Else return apostrophe S. For example First Name is James. Return James' (possessive). Else return "'s". For example Tony's. Thanks in advance -Tony Link to comment Share on other sites More sharing options...
ThomasLewis Posted January 24, 2012 Share Posted January 24, 2012 var str = Field("First Name"); if (str.substr(str.length -1, 1) == "s") str += "'"; else str += "'s" return str; Link to comment Share on other sites More sharing options...
Tony Olivas Posted January 24, 2012 Author Share Posted January 24, 2012 Thanks Thomas! That worked perfect. Once again this forum never disappoints! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.