るりまサーチ

最速Rubyリファレンスマニュアル検索!
310件ヒット [301-310件を表示] (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

検索結果

<< < ... 2 3 4 >>

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
//}...

Refinement#import_methods(*modules) -> self (66.0)

モジュールからメソッドをインポートします。

...ッドをコピーするため、Rubyコードで定義されたメソッドだけしか
インポートできないことに注意してください。

//emlist[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end

module M
refine String do
import_methods StrUtils...
...end
end

using M
p "foo".indent(3) # => " foo"

module M
refine String do
import_methods Enumerable
# Can't import method which is not defined with Ruby code: Enumerable#drop
end
end
//}...
<< < ... 2 3 4 >>