2 Replies Latest reply on Oct 12, 2009 12:00 PM by Minds Eye

    String diff

    Minds Eye Level 1

      Hello.

      Has anyone created a string diff handler?

      I want to compare 2 strings and work out the difference between them.

      i.e. some kind of function such as strDiff(string1, string2)

      which would return the delta change, insertion, or deletion information string2 in order to get back to string1

      For example,

        str1 = "This is a string"
         str2 = "This is a new string"

        put strDiff(str1, str2)

      which would give me something like:

      --[c,9,10,"the new"]

      (change char 9 to 10 to "the new")

       

      I though I better check here first to see if anyone has already created this type of function before I make an attempt.

       

      Cheers,

      Trevor