drewsimmons Posted May 27, 2014 Share Posted May 27, 2014 Hello all Im just trying to figure out how to create a rule that changes text to lower case but keeps acronyms in a job title all CAPS. I have attached a jpg with the example. The title in french is Spécialiste en services financiers, PME that info is pulled into the start of the paragraph which I applied a rule applied that changes it the entire Title to lowercase But I need the PME to remain all caps any help would be greatly appricated thanks Drew Quote Link to comment Share on other sites More sharing options...
FreightTrain Posted June 24, 2014 Share Posted June 24, 2014 Drew, There is no way for FusionPro to decipher what is a title and what is an acronym. If you can split these into 2 separate fields; one for "Title", another for the acronym "credentials". This will allow you to apply 2 different case rules to each field. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 24, 2014 Share Posted June 24, 2014 Try this: // This function goes in the rule or in JavaScript Globals: function ToLowerCase(string, leaveAllCapsWords) { function WordToLowerCaseUnicode(word) { if (leaveAllCapsWords && word == word.toUpperCase()) return word; //else return word.toLowerCase(); } return String(string).replace(/\S+/g, WordToLowerCaseUnicode); } // Usage: return ToLowerCase("Spécialiste en services financiers, PME", true); // OR: return ToLowerCase(Field("Your Field Name"), true); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.