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!
Solved! Go to Solution.
If your text is always Abc (x.y.z) format, as in your abbreviations are always in brackets, then you could use this piece of Arcade:
var i = Find('(',$feature.name1);
var n = Count($feature.name1);
var x = (n - i);
var rTXT = Upper(Right($feature.name1, x));
var lTXT = Proper(Left($feature.name1, i));
return Concatenate([lTXT,rTXT]);
In my test data the text field is called name1, you would use NAME.
Code works by locating the first open bracket and then uses that location to pull out the right text to set UPPER and the left text to set PROPER.
If your text is always Abc (x.y.z) format, as in your abbreviations are always in brackets, then you could use this piece of Arcade:
var i = Find('(',$feature.name1);
var n = Count($feature.name1);
var x = (n - i);
var rTXT = Upper(Right($feature.name1, x));
var lTXT = Proper(Left($feature.name1, i));
return Concatenate([lTXT,rTXT]);
In my test data the text field is called name1, you would use NAME.
Code works by locating the first open bracket and then uses that location to pull out the right text to set UPPER and the left text to set PROPER.
That totally worked!!! Thank you so much for the help!!!