mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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.
18 lines
685 B
Plaintext
18 lines
685 B
Plaintext
<h3>longest_common_substring function</h3>
|
|
Returns the longest common substring between two strings. This substring is the longest
|
|
string that is a substring of the two input strings. Eg, the longest common substring
|
|
of "ABABC" and "BABCA" is "ABC". The substring is case sensitive.
|
|
|
|
<h4>Syntax</h4>
|
|
<pre>longest_common_substring(string1,string2)</pre>
|
|
|
|
<h4>Arguments</h4>
|
|
string1 → a string<br />
|
|
string2 → a string<br />
|
|
|
|
<h4>Example</h4>
|
|
<pre> longest_common_substring('ABABC','BABCA') → 'ABC'</pre><br />
|
|
<pre> longest_common_substring('abcDeF','abcdef') → 'abc'</pre><br />
|
|
<pre> longest_common_substring(upper('abcDeF'),upper('abcdex')) → 'ABCDE'</pre>
|
|
|