Jump to content

capitalizing names with apostrophes


This topic is 6697 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a calculation field:

lastname_comma_firstname

my problem is that names that have apostrophes are showing like this:

John O'shea

when it should be John O'Shea

can anyone help me to write a calculation that will prevent this from happening ?

the letter following the apostrophe will never be a lower case letter.. as far as I can foretell

Link to comment
Share on other sites

Make a calculated text field cLastName =

If ( PatternCount ( LastName ; "'" ) ;

Replace ( LastName ; Position ( LastName ; "'" ; 1 ; 1 ) + 1 ; 1 ; Proper ( Middle ( LastName ; Position ( LastName ; "'" ; 1 ; 1 ) + 1 ; 1 ))) ;

LastName )

If you have your database set to use smart qoutes you must use a single smart quote in the 3 places where a single quote is used.

Link to comment
Share on other sites

This topic is 6697 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.