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 Quote 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; Quote 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! 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.