Like: Difference between revisions

From The K Language Wiki
Content added Content deleted
(Created page with "{{primitive|x like y|in=K7}} '''Like''' takes a pattern string <code>x</code> and string <code>y</code>, and performs a pattern match on it similar to SQL's LIKE keyword. <co...")
 
No edit summary
Line 2: Line 2:
'''Like''' takes a pattern string <code>x</code> and string <code>y</code>, and performs a pattern match on it similar to SQL's LIKE keyword.
'''Like''' takes a pattern string <code>x</code> and string <code>y</code>, and performs a pattern match on it similar to SQL's LIKE keyword.


<code>*</code> indicates a wildcard in the pattern.
<code>*</code> indicates a wildcard(any number of letters) in the pattern.

<code>?</code> indicates a wildcard(single letter) in the pattern.


<pre>
<pre>

Revision as of 11:05, 18 August 2021

Like
x like y
Supported in K7

Like takes a pattern string x and string y, and performs a pattern match on it similar to SQL's LIKE keyword.

* indicates a wildcard(any number of letters) in the pattern.

? indicates a wildcard(single letter) in the pattern.

 "abc" like "abc"
1
 "abc" like "*abc"
1
 "dsfasfsdabc" like "*abc"
1