るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

<< 1 2 3 ... > >>

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

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 行として数えてしまうのでダメ
//}...

Array#count -> Integer (24327.0)

レシーバの要素数を返します。

...ブロックを評価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
ary = [1, 2, 4, 2.0]
ary.count # => 4
ary.count(2) # => 2
ary.count{|x|x%2==0} # => 3
//}

@see Enumerable#count...

Array#count {|obj| ... } -> Integer (24327.0)

レシーバの要素数を返します。

...ブロックを評価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
ary = [1, 2, 4, 2.0]
ary.count # => 4
ary.count(2) # => 2
ary.count{|x|x%2==0} # => 3
//}

@see Enumerable#count...

Array#count(item) -> Integer (24327.0)

レシーバの要素数を返します。

...ブロックを評価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
ary = [1, 2, 4, 2.0]
ary.count # => 4
ary.count(2) # => 2
ary.count{|x|x%2==0} # => 3
//}

@see Enumerable#count...

Enumerable#count -> Integer (24327.0)

レシーバの要素数を返します。

...価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
enum = [1, 2, 4, 2].each
enum.count # => 4
enum.count(2) # => 2
enum.count{|x|x%2==0} # => 3
//}

@see Array#count...

絞り込み条件を変える

Enumerable#count {|obj| ... } -> Integer (24327.0)

レシーバの要素数を返します。

...価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
enum = [1, 2, 4, 2].each
enum.count # => 4
enum.count(2) # => 2
enum.count{|x|x%2==0} # => 3
//}

@see Array#count...

Enumerable#count(item) -> Integer (24327.0)

レシーバの要素数を返します。

...価して真になった要素の個数を
カウントして返します。

@param item カウント対象となる値。

//emlist[例][ruby]{
enum = [1, 2, 4, 2].each
enum.count # => 4
enum.count(2) # => 2
enum.count{|x|x%2==0} # => 3
//}

@see Array#count...

GC.count -> Integer (24307.0)

プロセス開始からガーベージコレクトを実行した回数を Integer で返し ます。

...プロセス開始からガーベージコレクトを実行した回数を Integer で返し
ます。

//emlist[例][ruby]{
GC.count # => 3
//}...

Gem::StreamUI::SilentProgressReporter#count -> nil (24301.0)

何もしません。

何もしません。

Gem::StreamUI::SimpleProgressReporter#count -> Integer (24301.0)

Gem::StreamUI::SimpleProgressReporter#updated が呼び出された回数を返します。

Gem::StreamUI::SimpleProgressReporter#updated が呼び出された回数を返します。

絞り込み条件を変える

<< 1 2 3 ... > >>