Add README
This commit is contained in:
parent
07020b8e00
commit
a1ebc06a20
3 changed files with 133 additions and 2 deletions
14
test/hasFoo.ts
Normal file
14
test/hasFoo.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/** Does this string contain foo, ignoring case?
|
||||
|
||||
hasFoo('___foo__') // => true
|
||||
hasFoo(' fOO ') // => true
|
||||
hasFoo('Foo.') // => true
|
||||
hasFoo('bar') // => false
|
||||
hasFoo('fo') // => false
|
||||
hasFoo('oo') // => false
|
||||
|
||||
*/
|
||||
function hasFoo(s: string): boolean {
|
||||
return null != s.match(/foo/)
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue