るりまサーチ

最速Rubyリファレンスマニュアル検索!
102件ヒット [1-100件を表示] (0.169秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle align_size_t

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

String#count(*chars) -> Integer (33232.0)

chars で指定された文字が文字列 self にいくつあるか数えます。

...chars で指定された文字が文字列 self にいくつあるか数えます。

検索する文字を示す引数 chars の形式は tr(1) と同じです。
つまり、「"a-c"」は文字 a から c を意味し、
「"^0-9"」のように文字列の先頭が「^」の場合は
指定文...
...を数える文字のパターン

//emlist[例][ruby]{
p 'abcdefg'.count('c') # => 1
p '123456789'.count('2378') # => 4
p '123456789'.count('2-8', '^4-6') # => 4

# ファイルの行数を数える
n_lines = File.read("foo").count("\n")

# ファイルの末尾に改行コ...
...ードがない場合にも対処する
buf = File.read("foo")
n_lines = buf.count("\n")
n_lines += 1 if /[^\n]\z/ =~ buf
# if /\n\z/ !~ buf だと空ファイルを 1 行として数えてしまうのでダメ
//}...

Scanf::FormatString#matched_count (15202.0)

@todo

...@todo...

Scanf::FormatString#spec_count (15202.0)

@todo

...@todo...

Net::HTTPHeader#basic_auth(account, password) -> [String] (6302.0)

Authorization: ヘッダを BASIC 認証用にセットします。

...Authorization: ヘッダを BASIC 認証用にセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net:...
...:HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (6302.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...oxy-Authorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(...
...uri.request_uri)
req.proxy_basic_auth("account", "password") # => ["Basic YWNjb3VudDpwYXNzd29yZA=="]
//}...

絞り込み条件を変える

UnboundMethod#inspect -> String (6227.0)

self を読みやすい文字列として返します。

...self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String
.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect...

UnboundMethod#to_s -> String (6227.0)

self を読みやすい文字列として返します。

...self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String
.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect...

CSV::Table#inspect -> String (6208.0)

モードとサイズを US-ASCII な文字列で返します。

...モードとサイズを US-ASCII な文字列で返します。

//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
t
able = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}...

Scanf::FormatString#prune(n=matched_count) (6202.0)

@todo

...@todo...

UnboundMethod#arity -> Integer (6131.0)

メソッドが受け付ける引数の数を返します。

...t[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end

p C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.inst...
...e_method(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3


String
.instance_method(:size).arity #=> 0
String
.instance_method(:replace).arity #=> 1
String
.instance_method(:squeeze).arity #=> -1
String
.instance_method(:count).arity...

絞り込み条件を変える

<< 1 2 > >>