Logo

Programming-Idioms

History of Idiom 39 > diff from v46 to v47

Edit summary for version 47 by programming-idioms.org:
[Elixir] 404

Version 46

2020-05-21, 20:14:51

Version 47

2020-05-21, 20:32:25

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Variables
ok,word,s
Variables
ok,word,s
Code
ok = String.contains?(s, word)
Code
ok = String.contains?(s, word)
Doc URL
http://elixir-lang.org/docs/stable/elixir/String.html#contains?/2
Doc URL
https://hexdocs.pm/elixir/String.html#contains?/2