Hi I am trying to automate a text box in a layout that I am creating so that all I need to do is add the map from and the title is automatically formatted. I've been working with arcade and have been using proper() function to do this. However there are instances when I need every character in a group capitalized. For example:

The title should read South Boundary Fire Protection District (F.P.D.) but when I use proper it generates (F.p.d.) instead. I have other areas with similar names so I was thinking I could capitalize the letter if it appears after a period or something along those lines.

This is the current code that I am using inside the expression builder, any suggestions or thoughts on how to this would be great. I'm not quite sure how to go about doing this, so thank you for the help!