るりまサーチ

最速Rubyリファレンスマニュアル検索!
18件ヒット [1-18件を表示] (0.022秒)
トップページ > クエリ:y[x] > クエリ:prefixes[x]

別のキーワード

  1. psych psych_y
  2. psych y
  3. kernel y
  4. kernel psych_y
  5. y kernel

ライブラリ

クラス

検索結果

REXML::Element#prefixes -> [String] (18119.0)

self の文脈で定義されている prefix を文字列の配列を返します。

...字列の配列を返します。

対象の要素とその外側の要素で定義されている prefix を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].prefixes # => ["x", "y"]
//}...

Symbol#start_with?(*prefixes) -> bool (3129.0)

self の先頭が prefixes のいずれかであるとき true を返します。

...self の先頭が prefixes のいずれかであるとき true を返します。

(self.to_s.start_with?と同じです。)

@param prefixes パターンを表す文字列または正規表現 (のリスト)

@see Symbol#end_with?

@see String#start_with?

//emlist[][ruby]{
:hello.start_with?("hel...
...l") #=> true
:hello.start_with?(/H/i) #=> true

# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}...