Testing for presence of substring : include « String « Ruby
- Ruby
- String
- include
Testing for presence of substring
s = "hello"
s.include?("ll") # => true: "hello" includes "ll"
s.include?(?H) # => false: "hello" does not include character H
Related examples in the same category