QGIS/resources/function_help/hamming_distance
Nyall Dawson feb3bee858 Add a bunch of optimised fuzzy string matching algorithms.
A new QgsStringUtils class has been added containing some
common fuzzy matching algorithms, including Levenshtein edit
distance and Soundex. These can be used for finding "similar"
strings in a table.

Expression functions for these algorithms have also been
added to a new "Fuzzy Matching" group.
2015-06-27 11:51:56 +10:00

18 lines
635 B
Plaintext

<h3>hamming_distance function</h3>
Returns the Hamming distance between two strings. This equates to the number of characters at
corresponding positions within the input strings where the characters are different. The input
strings must be the same length, and the comparison is case-sensitive.
<h4>Syntax</h4>
<pre>hamming_distance(string1,string2)</pre>
<h4>Arguments</h4>
string1 &rarr; a string<br />
string2 &rarr; a string<br />
<h4>Example</h4>
<pre> hamming_distance('abc','xec') &rarr; 2</pre><br />
<pre> hamming_distance('abc','ABc') &rarr; 2</pre><br />
<pre> hamming_distance(upper('abc'),upper('ABC')) &rarr; 0</pre>