7 Replies Latest reply on Feb 24, 2016 7:48 PM by user19752

    Uppercase first character when it comes after HTML code

    Morgan647

      Newbie here and hoping to get an answer to this issue I've been struggling with.

       

      I need to uppercase only the first letter in a field, which I have a script set up to do:

       

      Loop

      Set Field [MYFIELD; Lower (MYFIELD)]

      Set Field [MYFIELD; Replace (MYFIELD; 1; 1; Upper (Left (MYFIELD; 1)))]

      Go to Record/Request/Page[Next; Exit after last]

      End Loop

       

      But I also need to account for titles that start with itals or quotes. For example:

      "<i>Peter Pan</i>" needs to become "<i>Peter pan</i>"

      "<i>peter pan</i>" needs to become "<i>Peter pan</i>"

      "&#34;Peter Pan&#34;" needs to become "&#34;Peter pan&#34;"

      etc.

       

      I can’t just automatically uppercase any letter that comes after an ital tag or html code, though, because they may appear in the middle of the field:

      "Characters in <i>Peter Pan</i>" needs to become "Characters in <i>peter pan</i>"

       

      Obviously same goes for quotes within the field:

      "&#34;Peter Pan&#34; Characters" needs to become "&#34;Peter pan&#34; characters"

       

      I'm working in FileMaker Pro 7.

       

      Any advice much appreciated!