StringSearch.containsPattern

Tells whether str contains pattern

struct StringSearch(bool wide_char = false)
static
bool
containsPattern
(
in Char[] str
,,
size_t start = 0
)

Parameters

str Char[]

string to scan

pattern Char[]

search pattern

start size_t

search start index

Return Value

Type: bool

true if str contains pattern or false otherwise

Examples

test(!StringSearch!().containsPattern("Hello", "ll", 5));
test(StringSearch!().containsPattern("Hello", "ll", 2));
test(StringSearch!().containsPattern("Hello", "lo", 3));
test(!StringSearch!().containsPattern("Hello", "lo", 4));
test(StringSearch!().containsPattern("Hello", "lo", 3));
test(StringSearch!().containsPattern("Hello", "lo", 0));

Meta