別のキーワード
ライブラリ
- ビルトイン (2053)
- bigdecimal (12)
- csv (12)
- erb (12)
-
irb
/ cmd / help (12) - json (36)
-
json
/ add / struct (12) - kconv (12)
- mkmf (12)
-
net
/ http (84) - open-uri (60)
- optparse (180)
- pathname (24)
- rake (24)
-
rexml
/ document (180) -
rubygems
/ requirement (36) -
rubygems
/ specification (24) - stringio (86)
- strscan (132)
- uri (36)
-
webrick
/ httprequest (12) - win32ole (12)
クラス
- Array (33)
- BigDecimal (12)
- Binding (7)
- CSV (12)
- ERB (12)
- Encoding (12)
-
Encoding
:: Converter (72) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Enumerator (24)
- Exception (8)
-
Gem
:: Requirement (36) -
Gem
:: Specification (24) - IO (16)
-
IRB
:: ExtendCommand :: Help (12) -
JSON
:: Parser (12) - MatchData (26)
- Method (12)
- Module (600)
-
Net
:: HTTPGenericRequest (36) - Object (51)
- OptionParser (132)
- Pathname (24)
- Proc (12)
-
REXML
:: Attribute (36) -
REXML
:: Attributes (36) -
REXML
:: CData (12) -
REXML
:: DocType (24) -
REXML
:: Document (36) -
REXML
:: Instruction (24) -
REXML
:: Text (12) -
Rake
:: FileList (24) - Range (33)
- Refinement (4)
- Regexp (24)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (94) - String (776)
- StringIO (86)
- StringScanner (132)
- Struct (60)
- Symbol (27)
-
Thread
:: Backtrace :: Location (12) - Time (12)
- TrueClass (24)
-
URI
:: MailTo (36) - UnboundMethod (96)
- UncaughtThrowError (11)
-
WEBrick
:: HTTPRequest (12) -
WIN32OLE
_ VARIANT (12)
モジュール
キーワード
- % (26)
- == (12)
- === (12)
- [] (36)
- []= (24)
-
_ dump (24) -
absolute
_ path (24) -
alias
_ method (12) -
arg
_ config (12) - arity (12)
-
as
_ list (12) - attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) -
attribute
_ of (12) - autoload (12)
- autoload? (12)
-
base
_ label (12) -
basic
_ auth (12) - body (12)
- bytes (7)
- byteslice (36)
- captures (12)
- casecmp (24)
- casecmp? (18)
- charset (24)
-
check
_ until (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) - clone (12)
- concat (9)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - content (12)
-
content
_ encoding (12) -
content
_ type (12) - convert (12)
- count (12)
- deconstruct (2)
- dedup (3)
-
default
_ argv (12) -
define
_ method (24) -
delete
_ suffix (8) -
delete
_ suffix! (8) -
deprecate
_ constant (12) - disasm (12)
- disassemble (12)
- dummy? (12)
- dump (12)
- dup (24)
- each (12)
-
each
_ byte (24) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ grapheme _ cluster (16) -
each
_ line (24) - encode (36)
- encoding (12)
-
end
_ with? (6) - eql? (12)
-
error
_ bytes (12) -
error
_ char (12) - execute (12)
- fetch (12)
- finish (12)
-
force
_ encoding (12) -
get
_ byte (12) - getbyte (12)
- getch (12)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (60)
- headers (12)
-
import
_ methods (4) - include? (12)
-
insert
_ output (12) - inspect (67)
-
instance
_ method (12) - iseuc (12)
- label (12)
- length (12)
- lines (7)
- ljust (12)
- match? (12)
-
matched
_ size (12) - method (12)
-
method
_ defined? (12) -
module
_ function (36) - name (24)
-
named
_ captures (12) - namespace (12)
- namespaces (12)
- order! (48)
- pack (21)
- parse (24)
- parse! (24)
- path (24)
- permute (24)
- permute! (24)
- pread (8)
- prefix (12)
- prefixes (12)
- prepend (9)
-
pretty
_ print (12) - private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
proxy
_ basic _ auth (12) - public (60)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) - putback (24)
- puts (12)
- pwrite (8)
- query (12)
-
quote
_ char (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ method (12) - replacement= (12)
- result (12)
- rjust (12)
-
rubygems
_ version (12) -
scan
_ full (12) -
scan
_ until (12) - scrub (36)
- scrub! (36)
-
search
_ full (12) - size (12)
-
skip
_ until (12) - slice (12)
- slice! (12)
- source (24)
-
source
_ location (43) - squeeze (12)
- squeeze! (12)
-
stand
_ alone? (12) - status (12)
- step (19)
- strftime (12)
- sub (60)
- sub! (48)
-
sub
_ type (12) - succ (12)
- succ! (12)
- sum (12)
-
summary
_ indent (12) - target (12)
- then (7)
-
to
_ a (12) -
to
_ binary (10) -
to
_ json (36) -
to
_ mailtext (12) -
to
_ rfc822text (12) -
to
_ ruby (12) -
to
_ s (71) -
to
_ string (12) - truncate (12)
-
undef
_ method (12) - undump (8)
- ungetc (12)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
- unpack1 (9)
- unscan (12)
- upcase (12)
- upcase! (12)
- upto (12)
- value (36)
-
values
_ at (12) - version (12)
-
with
_ object (24) -
yield
_ self (8)
検索結果
先頭5件
-
Gem
:: Specification # to _ ruby -> String (18436.0) -
自身を再現するための Ruby スクリプトを文字列で返します。
...自身を再現するための Ruby スクリプトを文字列で返します。
省略されている値はデフォルト値が使用されます。... -
Gem
:: Specification # rubygems _ version -> String (18402.0) -
この Gem パッケージを作成した RubyGems のバージョンを返します。
...この Gem パッケージを作成した RubyGems のバージョンを返します。... -
String
# unpack(template) -> Array (16511.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...の要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表......big endian unsigned 16bit
N: big endian unsigned 32bit
v: little endian unsigned 16bit
V: little endian unsigned 32bit
//}
: エンディアン依存、整数サイズ依存 (C の構造体などに適切)
//emlist{
s!: signed short
S!: unsigned short
i,i!: signed int
I,I!: unsigned i......long
L!: unsigned long
q!: signed long long
Q!: unsigned long long
j,j!: intptr_t
J,J!: uintptr_t
//}
: エンディアン依存、整数サイズ非依存 (C99 の stdint.h にある厳密な幅を持つ整数型に適切)
//emlist{
s: int16_t
S: uint16_t
l: int32_t
L: uint32_t......素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ... -
String
# delete _ suffix(suffix) -> String (15344.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
...から suffix を削除した文字列のコピーを返します。
@param suffix 末尾から削除する文字列を指定します。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("he......l") # => "hello"
//}
@see String#chomp
@see String#chop
@see String#delete_prefix
@see String#delete_suffix!
@see String#end_with?... -
String
# gsub(pattern , replace) -> String (15270.0) -
文字列中で pattern にマッチする部分全てを 文字列 replace で置き換えた文字列を生成して返します。
...文字列と置き換える文字列
//emlist[例][ruby]{
p 'abcdefg'.gsub(/def/, '!!') # => "abc!!g"
p 'abcabc'.gsub(/b/, '<<\&>>') # => "a<<b>>ca<<b>>c"
p 'xxbbxbb'.gsub(/x+(b+)/, 'X<<\1>>') # => "X<<bb>>X<<bb>>"
p '2.5'.gsub('.', ',') # => "2,5"
//}
注意:
第 2 引数 repla......列が評価される時点ではまだ正規表現マッチが行われておらず、
$1 がセットされていないからです。
また、gsub では「\」が部分文字列との置き換えという特別な意味を持つため、
replace に「\」自身を入れたいときは
「\」......ある間違い][ruby]{
p 'xbbb-xbbb'.gsub(/x(b+)/, "#{$1}") # => "-" # NG
p 'xbbb-xbbb'.gsub(/x(b+)/, "\1") # => "1-1" # NG
p 'xbbb-xbbb'.gsub(/x(b+)/, "\\1") # => "bbb-bbb" # OK
p 'xbbb-xbbb'.gsub(/x(b+)/, '\1') # => "bbb-bbb" # OK
p 'xbbb-xbbb'.gsub(/x(b+)/, '\\1')... -
String
# upcase(*options) -> String (15268.0) -
全ての小文字を対応する大文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...のエンコーディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}
@see String#upcase!, String#downcase,
String#swapcase, String#capitalize... -
String
# sub(pattern , replace) -> String (15263.0) -
文字列中で pattern にマッチした最初の部分を 文字列 replace で置き換えた文字列を生成して返します。
...replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
p 'abcdefg'.sub(/def/, '!!') # => "abc!!g"
p 'abcabc'.sub(/b/, '<<\&>>') # => "a<<b>>cabc"
p 'xxbbxbb'.sub(/x+(b+)/, 'X<<\1>>') # => "X<<bb>>xbb"
//}
注意:
第 2 引数 replace に $1......列が評価される時点ではまだ正規表現マッチが行われておらず、
$1 がセットされていないからです。
また、sub では「\」が部分文字列との置き換えという特別な意味を持つため、
replace に「\」自身を入れたいときは
「\」......ある間違い][ruby]{
p 'xbbb-xbbb'.sub(/x(b+)/, "#{$1}") # => "-xbbb" # NG
p 'xbbb-xbbb'.sub(/x(b+)/, "\1") # => "1-xbbb" # NG
p 'xbbb-xbbb'.sub(/x(b+)/, "\\1") # => "bbb-xbbb" # OK
p 'xbbb-xbbb'.sub(/x(b+)/, '\1') # => "bbb-xbbb" # OK
p 'xbbb-xbbb'.sub(/x(b+)/, '\\1')... -
String
# unicode _ normalize(form = :nfc) -> String (15262.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。
...の正規化形式で Unicode 正規化し
た文字列を返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字列では......ドでの "Unicode 文字列" とは、UTF-8、UTF-16BE/LE、
UTF-32BE/LE だけではなく GB18030、UCS_2BE、and UCS_4BE を含みます。
また、self が UTF-8 以外のエンコーディングであった場合は一度 UTF-8 に変
換してから正規化されるため、UTF-8 よりも......います。
//emlist[例][ruby]{
"a\u0300".unicode_normalize # => 'à' ("\u00E0" と同じ)
"a\u0300".unicode_normalize(:nfc) # => 'à' ("\u00E0" と同じ)
"\u00E0".unicode_normalize(:nfd) # => 'à' ("a\u0300" と同じ)
"\xE0".force_encoding('ISO-8859-1').unicode_normalize(:nfd)... -
String
# upcase -> String (15262.0) -
'a' から 'z' までのアルファベット小文字を大文字に変換した文字列を作成して返します。
...字として認識する」だけであって、
いわゆる全角アルファベットの大文字小文字までは変換しません。
//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}
@see String#upcase!, String#downcase,
String#swapcase, String#capitalize... -
String
# scrub -> String (15258.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
...合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き......ブ
ロックの戻り値で置き換えられます。
//emlist[例][ruby]{
"abc\u3042\x81".scrub # => "abc\u3042\uFFFD"
"abc\u3042\x81".scrub("*") # => "abc\u3042*"
"abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack('H*')[0]+'>' } # => "abc\u3042<e380>"
//}
@see String#scrub!...