include?(substr) -> bool[permalink][rdoc][edit] 文字列中に部分文字列 substr が含まれていれば真を返します。 [PARAM] substr: 検索する文字列 例 "hello".include? "lo" #=> true "hello".include? "ol" #=> false "hello".include? ?h #=> true
include?(substr) -> bool[permalink][rdoc][edit] 文字列中に部分文字列 substr が含まれていれば真を返します。 [PARAM] substr: 検索する文字列 例 "hello".include? "lo" #=> true "hello".include? "ol" #=> false "hello".include? ?h #=> true
self[nth] -> String | nil[permalink][rdoc][edit] slice(nth) -> String | nil nth 番目の文字を返します。 nth が負の場合は文字列の末尾から数えます。つまり、 self.size + nth 番目の文字を返します。 nth が範囲外を指す場合は nil を返します。 [PARAM] nth: 文字の位置を表す整数 [RETURN] 指定した位置の文字を表す String オブジェクト 例 p 'bar'[2] # => "r" p 'bar'[2] == ?r # => true p 'bar'[-1] # => "r" p 'bar'[3] # => nil p 'bar'[-4] # => nil このメソッドの仕様は 1.8.x 以前から大きく変更されていますので注意が必要です。 self[nth, le
文字列の中に別途指定した文字列が含まれているかどうかを調べることができます。左端から右へ向かって調べる方法と右端から左へ向かって調べる方法が用意されています。ここでは Ruby で文字列に指定の文字列が含まれているか検索する方法について解説します。
Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く