elixir-lang/elixir — pull request #1188 by josephwilk (2013-06-04 17:41:27+00:00)
Title: Adding String.contains?

Along the lines of String.starts_with? and String.ends_with? I suggest `contains?`:

```elixir
String.contains? "elixir of life", "of" ; true
String.contains? "elixir of life", "mercury" ; false
```
###What
contains? detect whether a string contains another string.

### Why?
This is for a string match and you don't want to use regular expressions. For example I have a string which contains lots of regular expression reserved symbols and I don't want to go through the pain of escaping them or convert the string. Or I want something fast that bypasses regex.

### Erlang
Really I'm trying to replicate Erlangs string:str http://www.erlang.org/doc/man/string.html#str-2
though I only care about the boolean result rather than the position of matches.