3 Replies Latest reply on Jun 4, 2015 10:34 PM by philmodjunk

    Help with getString custom Function

    starstuff

      Title

      Help with getString custom Function

      Post

      Hello All!

       

      i found this getstring function by  Bob Patin Longterm Solutions,

       

      /*
      written by Bob Patin - Longterm Solutions
      WHAT IT DOES: creates a list of strings that include every permutation of the original string

      EXAMPLE::

      seven
      seve
      sev
      se
      s

      */

      Let (
      [
      len = Length ( data ) - 2
      ];

      If ( len > 0 ; data & ¶ & getStrings ( Left ( data ; len )) ; data )


      )

      Example from Demo

      Spears, Robert M Esq

      result

      Spears, Robert M Esq
      Spears, Robert M Es
      Spears, Robert M E
      Spears, Robert M
      Spears, Robert M
      Spears, Robert
      Spears, Robert
      Spears, Rober
      Spears, Robe
      Spears, Rob
      Spears, Ro
      Spears, R
      Spears,
      Spears,
      Spears
      Spear
      Spea
      Spe
      Sp
      S

      what i like to do is add other like Right(data), Middle(data) to create more terms , so something like this

      If ( len > 0 ; data & ¶ & getStrings ( Left ( data ; len )) ; data )

      then do this also

      data & ¶ & getStrings ( Right ( data ; len )

      then do this also

      data & ¶ & getStrings ( Middle ( data ; len )

       

      how to do that?

       

      Thanks!