るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

String#delete(*strs) -> String (27239.0)

self から strs に含まれる文字を取り除いた文字列を生成して返します。

...合は、
すべての引数にマッチする文字だけが削除されます。

@
param strs 削除する文字列を示す文字列 (のリスト)

//emlist[例][ruby]{
p "123456789".delete("2378") #=> "14569"
p "123456789".delete("2-8", "^4-6") #=> "14569"
//}

@
see String#delete!...

Net::HTTPHeader#delete(key) -> [String] | nil (18221.0)

key ヘッダフィールドを削除します。

...key ヘッダフィールドを削除します。

@
param key 削除するフィールド名
@
return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。

//emlist[例][ruby]{
require 'net/ht...
...tp'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length # => 10
req.delete("Content-Length") # => ["10"]
req.content_length # => nil
//}...

SDBM#delete(key) -> String (18221.0)

key をキーとする項目を削除します。

...key をキーとする項目を削除します。

@
param key キー。

@
return 削除した要素の値を返します。

require 'sdbm'

db1 = SDBM.open('aaa.gdbm', 0666)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
db1['c'] = 'ccc'

p db1.delete('a') #=> 'aaa'...

DBM#delete(key) -> String (18215.0)

key をキーとする要素を削除します。

...key をキーとする要素を削除します。

@
return 削除した要素の値を返します。

@
raise DBMError 要素の削除に失敗した場合に発生します。...

String#delete_suffix(suffix) -> String (15299.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#delete_prefix(prefix) -> String (15275.0)

文字列の先頭から 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_suffix!(suffix) -> self | nil (15198.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?...

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

self の先頭から破壊的に 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_suffi...
...x!
@see String#start_with?...

String#delete!(*strs) -> self | nil (15150.0)

self から strs に含まれる文字を破壊的に取り除きます。

...だけが削除されます。

@
return 通常は self を返しますが、何も変更が起こらなかった場合は nil を返します。

@
param strs 削除する文字列を示す文字列 (のリスト)

//emlist[例][ruby]{
str = "123456789"
p str.delete!("2378") #=> "14569"
p...
...str #=> "14569"

str = "123456789"
p str.delete!("2-8", "^4-6") #=> "14569"
p str #=> "14569"

str = "abc"
p str.delete!("2378") #=> "nil"
p str #=> "abc"
//}

@
see String#delete...

String#chop -> String (9174.0)

文字列の最後の文字を取り除いた新しい文字列を生成して返します。 ただし、文字列の終端が "\r\n" であればその 2 文字を取り除きます。

...ばその 2 文字を取り除きます。

//emlist[例][ruby]{
p "string\n".chop # => "string"
p "string\r\n".chop # => "string"
p "string".chop # => "strin"
p "strin".chop # => "stri"
p "".chop # => ""
//}

@
see String#chomp
@
see String#chop!
@
see String#delete_suffix...

絞り込み条件を変える

<< 1 2 > >>