User Tools

Site Tools


syntax:functions:distance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:functions:distance [2021/08/01 19:59] craigtsyntax:functions:distance [2021/08/14 22:02] (current) – [Examples] craigt
Line 31: Line 31:
 =====Examples===== =====Examples=====
  
-  distance("cat", "cat"= 0  //Strings are the same +  distance("cat", "cat") //Returns 0  (Strings are the same
-  distance("cat", "cut"= 1  //Change "a" to "u" + 
-  distance("cat", "dog"= 3  //Change "c" to "d", "a" to "o", and "t" to "g" +  distance("cat", "cut") //Returns 1  (Change "a" to "u"
-  distance("cat", "Scott"= 3  //Delete "S" and one of the "t"s, and change "a" to "o" + 
-  distance("Mary","mary"= 1  //Replace upper-case "M" with lower-case "m" +  distance("cat", "dog") //Returns 3  (Change "c" to "d", "a" to "o", and "t" to "g"
-  distance(100, 1) = 2  //Remove both "0"+ 
-  distance(100, "Bob"= 3  //Replace "1" with "M", replace "0" with "a", and replace "0" with "r"+  distance("cat", "Scott") //Returns 3  (Delete "S" and one of the "t"s, and change "a" to "o"
 + 
 +  distance("Mary","mary") //Returns 1  (Replace upper-case "M" with lower-case "m"
 + 
 +  distance(100, 1) //Returns 2  (Remove both "0"s
 + 
 +  distance(100, "Bob") //Returns 3  (Replace "1" with "M", replace "0" with "a", and replace "0" with "r")
  
syntax/functions/distance.txt · Last modified: 2021/08/14 22:02 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki