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:
=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