Open
Description
std::pattern::Pattern could be "hello".
Example:
let s = "hello world":
s.contains("hello"): // ==> true
But it is also faster to do multi checks instead of using multiple contains functions.
Bad practise
s.contains('a') || s.contains('b') // about 51ns because the string makes two checks.
I created myself a Pattern implementation which is about 19ns and does just one check. But I think there must be a own pattern syntax.
Something like:
s.contains('a' || 'b')
Metadata
Metadata
Assignees
Labels
No labels