Capitalize first letter of first word in a every sentence in ColdFusion

Ivan picture Ivan · May 22, 2014 · Viewed 9k times · Source

I want to get a string like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tempor pulvinar enim! Nec aliquam massa faucibus sed?? Praesent nec consectetur sapien... Nulla dapibus rutrum turpis, ac porta erat posuere vel.

starting from string in all uppercase (or lowercase). For example:

LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. DONEC TEMPOR PULVINAR ENIM! NEC ALIQUAM MASSA FAUCIBUS SED?? PRAESENT NEC CONSECTETUR SAPIEN... NULLA DAPIBUS RUTRUM TURPIS, AC PORTA ERAT POSUERE VEL.

How can I do? Thank you!

Answer

James A Mohler picture James A Mohler · May 22, 2014

I would use CSS rather than ColdFusion to do this

<span style="text-transform : capitalize"><cfoutput>#lcase(mystring)#</cfoutput></span>