IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#36947 - 08/17/11 10:09 AM O' Names How to keep capitalization correct
JulieK Offline
OL Newbie

Registered: 02/23/11
Posts: 7
Loc: Tampa, FL
How would one keep names such as O'Donal, O'Reilly, O'Mally with the first letter after the apostrophy capital when using Title case.
Thank you for you help
Julie
:-)

Top
#36952 - 08/17/11 11:21 AM Re: O' Names How to keep capitalization correct [Re: JulieK]
Benoit Potvin
Unregistered


Julie,

Note: For the benefit of readers, please note that the TitleCase function is part of a PlanetPress Talk library that can be imported in you

A solution could be to replace ' with a space, then apply the titlecase function, then replace the space with ' again, since the TitleCase function will capitalize every word of its input:

Code:

=stringreplace(@TitleCase(stringreplace(trim(@(1,1,15)), '\'', ' ')), ' ', '\'')



Here is a step by step explanation of how I got to this expression, with an sample data selection (" o'reilly").

1. A plain data selection:

=@(1,1,15)
Displays " o'reilly "


2. Let's get rid of spaces:

=trim(@(1,1,15))
Displays "o'reilly"

3. Replace any quote character by a space:

=stringreplace(trim(@(1,1,15)), '\'', ' ')
Displays "o reilly"

Note that since ' is a reserved character we have to use \'

4. Apply the TitleCase function:

=@TitleCase(stringreplace(trim(@(1,1,15)), '\'', ' '))
Displays "O Reilly"

5. Revert step 3 and put back the quote:

=stringreplace(@TitleCase(stringreplace(trim(@(1,1,15)), '\'', ' ')), ' ', '\'')
Displays "O'Reilly"


Hope this helps


Edited by Benoit Potvin (08/17/11 11:30 AM)

Top
#38007 - 12/08/11 05:55 PM Re: O' Names How to keep capitalization correct [Re: ]
Benoit Potvin
Unregistered


Quote:
Note: For the benefit of readers, please note that the TitleCase function is part of a PlanetPress Talk library that can be imported in you


hum...

Here's the complete phrase:

Note: For the benefit of readers, please note that the TitleCase function is part of a PlanetPress Talk library that can be imported in your PlanetPress Design Document.

Sorry for any misunderstanding smile

Top