Skip to content

Commit cff19b8

Browse files
authored
Create README.md
1 parent a624224 commit cff19b8

File tree

1 file changed

+18
-0
lines changed
  • Server-Side Components/Background Scripts/Capitalize Title Words

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This script will take a string and capitalize words that are not part of an exclusion list.
2+
The first and last words will always be capitalized even if normally excluded, according to MLA Format.
3+
4+
This is great for providing more consistently formatted Titles and Short Descriptions, especially when you have those users who just LOVE to exclusively use lowercase for everything.
5+
6+
You can use this code in a Business Rule (on insert) to make the modifications and provide more consistent formatting where applicable.
7+
8+
You can add to or remove from the list of excluded words via the "excludedWords" array in the "processTitle" function.
9+
10+
Set the "title" variable to the text you want to format. Often this will be a Short Description or similar field. Or you can call the "processTitle" function and pass in the string
11+
12+
*** An example run ***
13+
14+
Before String:
15+
the ultimate short description of the 21st century
16+
17+
After String:
18+
The Ultimate Short Description of the 21st Century

0 commit comments

Comments
 (0)