るりまサーチ

最速Rubyリファレンスマニュアル検索!
110件ヒット [1-100件を表示] (0.045秒)
トップページ > クエリ:String[x] > クエリ:code[x] > 種類:モジュール関数[x]

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Digest.#hexencode(string) -> String (6325.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("\xB...
....hexencode(digest) # => "58e53d1324eef6265fdb97b08ed9aadf"
p Digest::MD5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"

p digest = Digest::SHA1.digest("ruby") # => "\x18\xE4\x0E\x14\x01\xEE\xF6~\x1A\xE6\x9E\xFA\xB0\x9A\xFBq\xF8\x7F\xFB\x81"
p Digest.hexencode(diges...

Base64.#decode64(str) -> String (6202.0)

与えられた文字列を Base64 デコードしたデータを返します。

...文字列を指定します。

require 'base64'
str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' +
'ZSB0aHJlZQpBbmQgc28gb24uLi4K'
puts Base64.decode64(str)

# This is line one
# This is line two
# This is line three
# And so on......

Base64.#encode64(bin) -> String (6202.0)

与えられたデータを Base64 エンコードした文字列を返します。

...字ごとに改行を追加します。

@param bin Base64 エンコードするデータを指定します。


require 'base64'
Base64.encode64("Now is the time for all good coders\nto learn Ruby")

# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...

Base64.#strict_decode64(str) -> String (6202.0)

与えられた文字列を Base64 デコードしたデータを返します。

与えられた文字列を Base64 デコードしたデータを返します。

このメソッドは 4648 に対応しています。


@param str Base64 デコードする文字列を指定します。

@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例外は発生します。

Base64.#strict_encode64(bin) -> String (6202.0)

与えられたデータを Base64 エンコードした文字列を返します。

与えられたデータを Base64 エンコードした文字列を返します。

このメソッドは 4648 に対応しています。
改行コードを追加することはありません。

@param bin Base64 エンコードするデータを指定します。

絞り込み条件を変える

Base64.#urlsafe_decode64(str) -> String (6202.0)

与えられた文字列を Base64 デコードしたデータを返します。

与えられた文字列を Base64 デコードしたデータを返します。

このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。

@param str Base64 デコードする文字列を指定します。

@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例...

Base64.#urlsafe_encode64(bin, padding: true) -> String (6202.0)

与えられたデータを Base64 エンコードした文字列を返します。

...データを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。

//emlist[例][ruby]{
require 'base64'

p Base64.urlsafe_encode64('hoge')
# => "aG9nZQ=="

p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}...

ERB::Util.#url_encode(s) -> String (3203.0)

文字列 s を URLエンコードした文字列を返します。

...を返します(CGI.escapeとほぼ同じです)。

@param s URLエンコードを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
//}...

Kconv.#kconv(str, out_code, in_code = Kconv::AUTO) -> String (370.0)

文字列 str のエンコーディングを out_code に変換したものを 返します。in_code も指定されていたら str のエンコーディングが in_code だとして動作します。

...文字列 str のエンコーディングを out_code に変換したものを
返します。in_code も指定されていたら str のエンコーディングが
in_code だとして動作します。

このメソッドはMIME エンコードされた文字列を展開し、
いわゆる半角...
...カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf を使ってください。

@param str 変換元の文字列
@param out_code 変換後のエンコーディング
@param in_code strのエンコーディング

@see String#kconv...

WEBrick::HTTPStatus.#reason_phrase(code) -> String (209.0)

指定された整数が表すステータスコードに対応する reason phrase を表す文字列を返します。

...指定された整数が表すステータスコードに対応する reason phrase
を表す文字列を返します。

@param code HTTP のステータスコードを表す整数か文字列を指定します。

require 'webrick'
p WEBrick::HTTPStatus.reason_phrase(304) #=> "Not Modified"...

絞り込み条件を変える

<< 1 2 > >>