# FirstsCaps

**URL:** <https://community.glideapps.com/t/firstscaps/29979>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [August 4, 2021, 10:22am UTC](https://community.glideapps.com/t/firstscaps/29979 "2021-08-04T10:22:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [August 4, 2021, 10:22am UTC](https://community.glideapps.com/t/firstscaps/29979/1 "2021-08-04T10:22:15Z")

</div>

Lowercase the string and adds a capital letter to the first letter of each word in the string. Optionally add the capital letter even after a character (or sequence of characters) other than space.

**Example 1**  
stringToCaps: the cup is on the table  
_RETURN: The Cup Is On The Table_

**Example 2**  
stringToCaps: heLLo WORLD  
_RETURN: Hello World_

\*\*Example 3 (typical case) \*\*  
stringToCaps: giuseppe d’amico  
separatorChar: ’  
_RETURN: Giuseppe D’Amico_

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/d/ddba34caa9321d75e36b4561efc841f3d0e93344.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/e/8e3ae7cfabd308918a6198f6f7f532b58d825e58.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c00f4aba4c146d989a1dfa52324ef50b7ca72792.png)

**Use case**  
Often when submitting a form, some users hastily omit the capital letter in their name, or write it all in uppercase. So it is bad to repeat their name in the APP in the same way it was wrongly written.

**Note**  
This function can also be performed in CSS, but if the data is to be transmitted externally to the APP, the same result would not be obtained.  
This function could certainly be improved by using regular expressions.

To fork: [FirstsCaps - Replit](https://replit.com/@EmporioVapori/FirstsCaps)
