1 Reply Latest reply on Oct 26, 2009 8:54 AM by Ned Murphy

    Move text from one column to another depending on character count

    drahkmar2

      Hello,

       

      I am trying to find a way to have text start in a specific column depending on the character count.

       

      Basically our site will have 3 columns. For example if the text only has about 300 Characters - it would start in the right column. If it had between 301 & 600 characters - it would start in the middle column and run to the right column. If it had more than 601 characters - it would start in the left column and run to the middle then right column.

       

      Is this possible?

       

      Thanks in advance for any help!

       

      James

        • 1. Re: Move text from one column to another depending on character count
          Ned Murphy Adobe Community Professional & MVP

          If you look at the String class you can probably devise a series of steps to do what you want using some basic logic.  The String class has a length property that tells you how many characters it contains.  Assuming you wouldn't want to split words, you could use something like the indexOf method to find the nearest blank space following the 300th character.  Then you would be wanting to build different strings for the different segments you create.

          1 person found this helpful