title: How to measure the level of similarity of 2 strings
body: <p>I need to create some algorithm that will count the level of similarity of two strings with equal size.</p>
  <p>For example we have one string with size 10.
  And several strings with size 10 that we should measure.</p>
  <p>First has one part of 9 symbol similar (9 from 10)</p>
  <p>Second has two parts of 7 and 2 symbols</p>
  <p>Third has 3 parts for (4, 3, 1) symbols</p>
  <p>4th 8 symbols</p>
  <p>5th has one part with 6 symbols</p>
  <p>I need some algorithm that will range all this strings for the level of similarity.
  As i understand the longer one part is the more similar are strings. But for example what is better one part with 8 elements or two with 7 and 2 elements. One part with 6 element or 3 parts with 4, 3, 1 segments that have 8 symbols at sum. Any advice?</p>
  <p>P.S. guys, i dont need algoritm how tp compare strings, i need algoritm how to count difference, how to define similarity if i have already several common parts in two strings.</p>
  <p>Initial string &quot;i like apple&quot;</p>
  <ol start="2">
  <li>&quot;apple i like&quot; (apple i like)</li>
  <li>&quot;i like appel&quot; (i like app l e)</li>
  <li>&quot;i like papel&quot; (i like ap p l e)</li>
  <li>&quot;i like pleap&quot; (i like ap ple)</li>
  <li>&quot;i like mango&quot; (i like a)</li>
  </ol>
  <p>It should be some math that count general length of string, length of parts that &quot;cover&quot; initial string and maybe some additio al parameter (if less parts - than better for similarity !!maybe!!)</p>