るりまサーチ

最速Rubyリファレンスマニュアル検索!
82件ヒット [1-82件を表示] (0.120秒)

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub!

ライブラリ

クラス

モジュール

検索結果

REXML::Namespace#prefix -> String (18231.0)

prefix (前置修飾子) を返します。

...prefix (前置修飾子) を返します。

@
see REXML::Namespace#prefix=...

String#delete_prefix(prefix) -> String (15398.0)

文字列の先頭から prefix を削除した文字列のコピーを返します。

... prefix を削除した文字列のコピーを返します。

@
param prefix 先頭から削除する文字列を指定します。

@
return 文字列の先頭から prefix を削除した文字列のコピー

//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo")...
...# => "hello"
//}

@
see String#delete_prefix!
@
see String#delete_suffix
@
see String#start_with?...

String#delete_prefix!(prefix) -> self | nil (15291.0)

self の先頭から破壊的に prefix を削除します。

...的に prefix を削除します。

@
param prefix 先頭から削除する文字列を指定します。

@
return 削除した場合は self、変化しなかった場合は nil

//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}

@
see String#delete...
..._prefix
@
see String#delete_suffix!
@
see String#start_with?...

String#delete_suffix(suffix) -> String (9180.0)

文字列の末尾から suffix を削除した文字列のコピーを返します。

...

@
param suffix 末尾から削除する文字列を指定します。

@
return 文字列の末尾から suffix を削除した文字列のコピー

//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}

@
see String#chomp
@
see String#chop
@
see String...
...#delete_prefix
@
see String#delete_suffix!
@
see String#end_with?...

String#start_with?(*prefixes) -> bool (9179.0)

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

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

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

//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?...
...("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}

@
see String#end_with?
@
see String#delete_prefix, String#delete_prefix!...

絞り込み条件を変える

String#delete_suffix!(suffix) -> self | nil (9079.0)

self の末尾から破壊的に suffix を削除します。

...

@
param suffix 末尾から削除する文字列を指定します。

@
return 削除した場合は self、変化しなかった場合は nil

//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}

@
see String#chomp!
@
see String#chop!
@
see String#d...
...elete_prefix!
@
see String#delete_suffix
@
see String#end_with?...

REXML::Namespace#expanded_name -> String (132.0)

REXML::Namespace#name= で設定された名前を返します。

...REXML::Namespace#name= で設定された名前を返します。

name= で指定した名前が prefix を含んでいれば
prefix
を含む名前を返し、そうでなければ
prefix
を含まない名前を返します。

@
see REXML::Namespace#prefix...

Symbol#start_with?(*prefixes) -> bool (125.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
//}...

REXML::Attribute#namespace(arg = nil) -> String | nil (114.0)

属性の名前空間の URI を返します。

...属性の名前空間の URI を返します。

URI が定義されていない場合は nil を返します。

@
param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlis...
...t[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...