nushell/docs/commands/str_contains.md
Justin Ma c0a1d18e3d
update #4455, regenerate commands' docs and update make_docs script (#4586)
* feat: update #4455, regenerate commands' docs

* chore: update make_docs script
2022-02-21 11:26:00 -06:00

966 B

title layout version
str contains command 0.59.0

Checks if string contains pattern

Signature

> str contains (pattern) ...rest --insensitive

Parameters

  • pattern: the pattern to find
  • ...rest: optionally check if string contains pattern by column paths
  • --insensitive: search is case insensitive

Examples

Check if string contains pattern

> 'my_library.rb' | str contains '.rb'

Check if string contains pattern case insensitive

> 'my_library.rb' | str contains -i '.RB'

Check if string contains pattern in a table

>  [[ColA ColB]; [test 100]] | str contains 'e' ColA

Check if string contains pattern in a table

>  [[ColA ColB]; [test 100]] | str contains -i 'E' ColA

Check if string contains pattern in a table

>  [[ColA ColB]; [test hello]] | str contains 'e' ColA ColB

Check if string contains pattern

> 'hello' | str contains 'banana'