include?(substr) -> bool[permalink][rdoc][edit]-
文字列中に部分文字列 substr が含まれていれば真を返します。
- [PARAM]
substr: - 検索する文字列
p "hello".include? "lo" #=> true p "hello".include? "ol" #=> false p "hello".include? ?h #=> true - [PARAM]
このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ
include?(substr) -> bool[permalink][rdoc][edit]文字列中に部分文字列 substr が含まれていれば真を返します。
substr:p "hello".include? "lo" #=> true
p "hello".include? "ol" #=> false
p "hello".include? ?h #=> true