QGIS/resources/function_help/longest_common_substring
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
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 &rarr; a string<br />
string2 &rarr; a string<br />
<h4>Example</h4>
<pre> longest_common_substring('ABABC','BABCA') &rarr; 'ABC'</pre><br />
<pre> longest_common_substring('abcDeF','abcdef') &rarr; 'abc'</pre><br />
<pre> longest_common_substring(upper('abcDeF'),upper('abcdex')) &rarr; 'ABCDE'</pre>