るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

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

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

...す。

@
param chars 出現回数を数える文字のパターン

//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 (9118.0)

@todo

...@todo...

Scanf::FormatString#spec_count (9118.0)

@todo

...@todo...

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

@todo

...@todo...

Net::HTTPHeader#basic_auth(account, password) -> [String] (214.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:...

絞り込み条件を変える

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

Proxy 認証のために Proxy-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",...

UnboundMethod#inspect -> String (133.0)

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

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

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

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

@
see Method#inspect...

UnboundMethod#to_s -> String (133.0)

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

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

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

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

@
see Method#inspect...