mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
10 lines
269 B
Nim
10 lines
269 B
Nim
import future, sequtils
|
|
|
|
proc any[T](list: varargs[T], pred: (T) -> bool): bool =
|
|
for item in list:
|
|
if pred(item):
|
|
result = true
|
|
break
|
|
|
|
proc contains(s: string, words: varargs[string]): bool =
|
|
any(words, (word) => s.contains(word)) |