るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. ipaddr to_i

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

String#each_codepoint {|codepoint| block } -> self (21500.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

StringIO#each_codepoint {|codepoint| ... } -> self (21500.0)

自身の各コードポイントに対して繰り返します。

...自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint...

String#each_codepoint -> Enumerator (21300.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

StringIO#each_codepoint -> Enumerator (21300.0)

自身の各コードポイントに対して繰り返します。

...自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint...

Net::HTTPResponse#code -> String (21207.0)

HTTP のリザルトコードです。例えば '302' などです。

...
H
TTP のリザルトコードです。例えば '302' などです。

この値を見ることでレスポンスの種類を判別できますが、
レスポンスオブジェクトがどのクラスのインスタンスかを
見ることでもレスポンスの種類を判別できます。

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

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.code # => "200"
//}...

絞り込み条件を変える

StringIO#each_codepoint {|codepoint| ... } -> self (18500.0)

自身の各コードポイントに対して繰り返します。

...自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint...

IO#each_codepoint -> Enumerator (18312.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

...
I
O の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
I
O.write("testfile", "abcde...
...あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}...

IO#each_codepoint {|c| ... } -> self (18312.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

...
I
O の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
I
O.write("testfile", "abcde...
...あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}...

ARGF.class#each_codepoint -> Enumerator (18300.0)

self の各コードポイントに対して繰り返しブロックを呼びだします。

...umerator を返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108...

ARGF.class#each_codepoint { |c| ... } -> self (18300.0)

self の各コードポイントに対して繰り返しブロックを呼びだします。

...umerator を返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108...

絞り込み条件を変える

StringIO#each_codepoint -> Enumerator (18300.0)

自身の各コードポイントに対して繰り返します。

...自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint...

Digest.#hexencode(string) -> String (15400.0)

引数である文字列 string を、16進数に変換した文字列を生成して返します。

...列 string を、16進数に変換した文字列を生成して返します。

@param string 文字列を指定します。

//emlist[][ruby]{
require 'digest'

p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB0")...
..."b0"

p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(digest) # => "58e53d1324eef6265fdb97b08ed9aadf"
p Digest::MD5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"

p digest = Digest::SHA1.digest("rub...
...B\x81"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hexdigest("ruby") # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
//}

文字列から16進数に変換したハッシュ値を直接得たい場合は、Digest::Base.hexdigest を...
<< 1 2 3 > >>