るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

StringScanner#pos=(n) (3013.0)

スキャンポインタのインデックスを n にセットします。

...t[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"

begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 #...

CSV::Table#[](index) -> CSV::Row | [String] | nil (210.0)

ミックスモードでは、このメソッドは引数に行番号を指定すれば行単位で動作 し、ヘッダの名前を指定すれば列単位で動作します。

..._col! を呼び出すとカラム
モードになります。また CSV::Table#by_row! を呼び出すとロウモード
になります。

@param index ミックスモード・ロウモードでは、取得したい行の行番号を整数で指定します。
カラムモードでは...

MatchData#values_at(*index) -> [String] (209.0)

正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。

...にマッチした部分文字列の配列を返します。

0 番目は $& のようにマッチした文字列全体を表します。

@param index インデックスを整数またはシンボル(名前付きキャプチャの場合)で 0 個以上指定します。

//emlist[例][ruby]{
m = /(...

Net::HTTPHeader#fetch(key) -> String (122.0)

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...= URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(ur...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (122.0)

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...= URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(ur...

絞り込み条件を変える

Net::HTTPHeader#fetch(key, default) -> String (122.0)

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...= URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(ur...

Net::HTTPGenericRequest#path -> String (114.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}...

CSV::Table#[](header) -> [String] | [nil] (110.0)

ミックスモードでは、このメソッドは引数に行番号を指定すれば行単位で動作 し、ヘッダの名前を指定すれば列単位で動作します。

..._col! を呼び出すとカラム
モードになります。また CSV::Table#by_row! を呼び出すとロウモード
になります。

@param index ミックスモード・ロウモードでは、取得したい行の行番号を整数で指定します。
カラムモードでは...

Net::HTTPResponse#body -> String | () | nil (109.0)

エンティティボディを返します。

...dapter のインスタンスを返しますが、
これは使わないでください。

entity は obsolete です。

//emlist[例][ruby]{
require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}...
<< < 1 2 3 4 5 ... > >>