Brian Dunning's FileMaker Custom Functions

CapitalizeFirstCharacter ( text )

This function removes spaces at the beginning of the text in question and then capitalizes the first character.

  Average rating: 4.6 (19 votes) Log in to vote

Tim Cimbura   Tim Cimbura - Show more from this author
LuminFire
http://luminfire.com

Share on Facebook Share on Twitter

  Sample input:
CapitalizeFirstCharacter(" this is a demo")
  Sample output:
"This is a demo"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function removes spaces at the beginning of the text in question and then capitalizes the first character.

 

Comments

Bruce   Bruce, Redmond WA
Mar 6, 2016
Your use of trim is inconsistent and so the expression doesn't work if there is a leading trimmable character.

Should be:
Replace ( Trim ( text ) ; 1 ; 1 ; Upper ( Left ( trim(text) ; 1 ) ) )
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: