るりまサーチ

最速Rubyリファレンスマニュアル検索!
310件ヒット [201-300件を表示] (0.080秒)
トップページ > クエリ:ruby[x] > クエリ:Ruby[x] > クエリ:string[x] > クエリ:String[x] > クエリ:code[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

検索結果

<< < 1 2 3 4 > >>

URI.encode_www_form_component(str, enc=nil) -> String (6338.0)

文字列を URL-encoded form data の1コンポーネント としてエンコードした文字列を返します。

...文字列を URL-encoded form data の1コンポーネント
としてエンコードした文字列を返します。

通常は URI.encode_www_form を使うほうがよいでしょう。

このメソッドでは *, -, ., 0-9, A-Z, _, a-z, は変換せず、
空白は + に変換し、その他...
...ttps://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data
にもとづいて実装されています。

//emlist[][ruby]{
require 'uri'
p URI.encode_www_form_component('Ruby リファレンスマニュアル')
# => "Ruby+%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9%E3%8...
...3%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB"
//}

@param str エンコードする文字列
@param enc 指定された場合、パーセントエンコーディングする前に、strをこのエンコーディングに変換
@see URI.decode_www_form_component, URI.encode_www_form...

URI.encode(str, unsafe = URI::UNSAFE) -> String (6316.0)

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

...I 文字列をエンコードした文字列を返します。

このメソッドは obsolete です。

代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は...

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

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

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

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


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

# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...

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

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

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

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

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

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

WIN32OLE.codepage -> Integer (6124.0)

WIN32OLEがOLEオートメーションのインターフェイスに利用するコードページを 取得します。

...ージを
取得します。

OLEオートメーションに利用する文字列はUnicodeでエンコードします。
WIN32OLEはここで示されたコードページを利用してRubyStringとUnicodeの相
互変換を行います。

ロード時の既定値はEncoding.default_internal...
...するコード
ページが見つからない場合は、WIN32OLE::CP_ACPを利用します。

@return WIN32OLEがオートメーション呼び出しの文字列変換に利用するコード
ページを返します。

WIN32OLE.codepage # => 932 (日本語Windowsの既定値)...

絞り込み条件を変える

ERB::Util.#url_encode(s) -> String (3340.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
//}...

URI.escape(str, unsafe = URI::UNSAFE) -> String (3216.0)

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

...I 文字列をエンコードした文字列を返します。

このメソッドは obsolete です。

代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は...

Regexp.compile(string, option = nil, code = nil) -> Regexp (368.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。

@param string 正規表現を文字列として与えま...
...して見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。

@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ...
...の指定は警告を出力します。

@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。

//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"

t2 = Regexp.compile('
th...

Regexp.new(string, option = nil, code = nil) -> Regexp (368.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。

@param string 正規表現を文字列として与えま...
...して見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。

@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ...
...の指定は警告を出力します。

@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。

//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"

t2 = Regexp.compile('
th...

kconv (162.0)

日本語文字コードの変換を手軽に行うためのライブラリです。

...

kconv を require すると String クラスに変換用のメソッドが定義されます。
Kconv にも同等のメソッドが定義されます。 Kconv には
エンコーディングを表す定数も定義されています。

1.9.1 以降では、Ruby の m17n 機能を用いてエ...
.../emlist[][ruby]{
require 'kconv'
newstring = Kconv.kconv(string, Kconv::JIS, Kconv::AUTO)
newstring = Kconv.tojis(string)
newstring = Kconv.toeuc(string)
newstring = Kconv.tosjis(string)
guessed_code = Kconv.guess(string)
//}

または

//emlist[][ruby]{
require 'kconv'
newstring = string.kconv(Kco...
...nv::JIS, Kconv::AUTO)
newstring = string.tojis
newstring = string.toeuc
newstring = string.tosjis
//}...

絞り込み条件を変える

<< < 1 2 3 4 > >>