別のキーワード
ライブラリ
- ビルトイン (3870)
- abbrev (12)
- bigdecimal (60)
-
cgi
/ core (12) - csv (132)
- digest (60)
- erb (24)
-
irb
/ cmd / help (12) - json (108)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - logger (12)
- mkmf (12)
-
net
/ http (132) - openssl (12)
- optparse (396)
- pathname (36)
- psych (12)
- rake (24)
-
rexml
/ document (132) -
rubygems
/ installer (12) -
rubygems
/ requirement (12) - socket (12)
- stringio (292)
- strscan (300)
- uri (36)
- win32ole (36)
クラス
-
ARGF
. class (84) - Array (81)
- BasicObject (12)
- BigDecimal (72)
- CGI (12)
- CSV (72)
-
CSV
:: Table (36) - Complex (12)
- Date (12)
- DateTime (12)
-
Digest
:: Base (60) - Dir (19)
- ERB (24)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) - Enumerator (24)
- Exception (44)
- File (16)
- Float (24)
-
Gem
:: Installer (12) -
Gem
:: Requirement (12) - IO (64)
-
IRB
:: ExtendCommand :: Help (12) - Integer (60)
- Logger (12)
- MatchData (110)
- Method (36)
- Module (600)
-
Net
:: HTTPGenericRequest (12) -
Net
:: HTTPResponse (24) - NilClass (7)
- Object (237)
-
OpenSSL
:: BN (12) - OptionParser (348)
- Pathname (36)
- Proc (12)
-
Psych
:: ScalarScanner (12) -
REXML
:: Attribute (12) -
REXML
:: Attributes (12) -
REXML
:: CData (24) -
REXML
:: DocType (24) -
REXML
:: Element (24) -
REXML
:: Entity (12) -
REXML
:: Text (24) -
Rake
:: FileList (24) - Random (12)
- Range (100)
- Rational (36)
- Regexp (60)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (94) - Socket (12)
- String (1875)
- StringIO (292)
- StringScanner (300)
- Struct (24)
- Symbol (59)
- Thread (10)
-
Thread
:: Backtrace :: Location (72) - Time (24)
- TracePoint (19)
-
URI
:: MailTo (36) - UnboundMethod (60)
-
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ TYPELIB (12) -
WIN32OLE
_ VARIANT (12)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (12)
-
Net
:: HTTPHeader (96) -
OptionParser
:: Arguable (48)
キーワード
- % (26)
- * (36)
- + (12)
- +@ (10)
- -@ (10)
- << (24)
- <=> (24)
- == (24)
- === (48)
- =~ (40)
- [] (204)
- []= (84)
-
_ _ id _ _ (12) -
_ dump (24) - abbrev (12)
-
absolute
_ path (24) -
add
_ element (12) -
alias
_ method (12) -
append
_ as _ bytes (1) -
arg
_ config (12) - attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) -
attribute
_ of (12) - autoload (12)
- autoload? (12)
- backtrace (12)
-
base
_ label (24) -
basic
_ auth (12) - binread (12)
- body (12)
- byteindex (3)
- byterindex (3)
- bytes (50)
- bytesize (12)
- byteslice (36)
- capitalize (12)
- capitalize! (12)
- captures (12)
- casecmp (24)
- casecmp? (18)
- center (12)
- charpos (12)
- chars (24)
- check (12)
-
check
_ until (12) - children (7)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (36)
- class (12)
-
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) - clear (12)
- clone (12)
- codepoints (24)
- coerce (12)
-
col
_ sep (12) - concat (33)
- connect (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - convert (12)
- count (12)
- cover? (19)
- crypt (12)
-
datetime
_ format (12) - deconstruct (2)
- dedup (3)
-
default
_ argv (12) -
define
_ method (24) -
define
_ singleton _ method (24) - delete (24)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) -
deprecate
_ constant (12) - digest (12)
- digest! (12)
- disasm (12)
- disassemble (12)
- downcase (12)
- downcase! (12)
- dump (8)
- dup (12)
- each (24)
-
each
_ byte (48) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (48) - encode (36)
- encode! (24)
- encoding (12)
-
end
_ with? (18) - entity (12)
- environment (12)
- eql? (24)
-
error
_ bytes (12) -
eval
_ script (7) - execute (12)
- exist? (12)
- ext (12)
- fetch (36)
- finish (12)
-
force
_ encoding (12) -
formatted
_ program _ filename (12) - freeze (12)
-
get
_ fields (12) - getbyte (24)
- getc (24)
- gets (60)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (24)
- header (12)
- headers (12)
- helpfile (12)
- hex (12)
- hexdigest (12)
- hexdigest! (12)
- include? (12)
- index (12)
-
inplace
_ mode (12) - insert (12)
-
insert
_ output (12) - inspect (163)
-
instance
_ method (12) - join (12)
- label (24)
- length (12)
- lines (38)
- ljust (12)
- lstrip (12)
- match (24)
- match? (30)
- method (12)
-
method
_ defined? (12) -
module
_ function (36) - name (17)
- name= (10)
- namespace (12)
- next! (12)
- oct (12)
- on (144)
- ord (24)
- order (48)
- order! (48)
- pack (21)
- parse (24)
- parse! (24)
-
parse
_ csv (12) - partition (12)
- path (56)
- pathmap (12)
- peek (12)
- peep (12)
- permute (24)
- permute! (24)
- pointer (12)
- pointer= (12)
- pos (12)
- pos= (12)
-
post
_ match (12) -
pre
_ match (12) - pread (8)
- prepend (21)
-
pretty
_ print (12) - print (24)
- printf (12)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
program
_ name (12) -
protected
_ method _ defined? (12) -
proxy
_ basic _ auth (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) - putback (24)
- puts (12)
- pwrite (8)
-
quote
_ char (12) - read (24)
-
read
_ body (24) - readbyte (12)
- readchar (24)
- readline (24)
- readlines (48)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ method (12) - reopen (24)
- replacement (12)
- replacement= (12)
- reset (12)
- result (12)
- rindex (12)
- rjust (12)
-
row
_ sep (12) - rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (36)
-
scan
_ full (12) -
scan
_ until (12) - scrub (36)
- scrub! (36)
-
search
_ full (12) -
set
_ backtrace (12) - setbyte (12)
- shift (12)
-
singleton
_ class (12) -
singleton
_ method (12) - size (12)
- skip (12)
-
skip
_ until (12) - slice (72)
-
source
_ location (36) - split (31)
- squeeze (12)
- squeeze! (12)
- src (12)
-
start
_ with? (18) - step (31)
- strftime (12)
- strip (12)
- strip! (12)
- sub (60)
- sub! (36)
- succ! (12)
- sum (12)
-
summary
_ indent (12) - swapcase (12)
- swapcase! (12)
- syswrite (12)
- tainted? (6)
- terminate (12)
- text (12)
- then (14)
-
to
_ a (12) -
to
_ binary (10) -
to
_ c (12) -
to
_ csv (12) -
to
_ f (12) -
to
_ i (12) -
to
_ json (228) -
to
_ mailtext (12) -
to
_ path (8) -
to
_ r (12) -
to
_ rfc822text (12) -
to
_ s (204) -
to
_ str (12) - tokenize (12)
- tr (12)
-
tr
_ s (12) -
tr
_ s! (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) -
with
_ object (24) - write (12)
-
yield
_ self (16)
検索結果
先頭5件
-
String
# slice(nth , len) -> String | nil (9288.0) -
nth 文字目から長さ len 文字の部分文字列を新しく作って返します。 nth が負の場合は文字列の末尾から数えます。
...数えます。
@param nth 取得したい文字列の開始インデックスを整数で指定します。
@param len 取得したい文字列の長さを正の整数で指定します。
@return nth が範囲外を指す場合は nil を返します。
//emlist[例][ruby]{
str0 = "bar"
s......#=> ""
str0[2, 100] #=> "r" (右側を超えても平気)
str0[-1, 1] #=> "r"
str0[-1, 2] #=> "r" (右に向かって len 文字)
str0[3, 1] #=> ""
str0[4, 1] #=> nil
str0[-4, 1] #=> nil
str1 = str0[0, 2] # (str0 の「一部」を str1 と... -
String
# delete _ suffix(suffix) -> String (9286.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
...
@param suffix 末尾から削除する文字列を指定します。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}
@see String#chomp
@see String#chop
@see String......#delete_prefix
@see String#delete_suffix!
@see String#end_with?... -
String
# lines(rs = $ / , chomp: false) -> [String] (9286.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区......s を取り除きます。
//emlist[][ruby]{
"hello\nworld\n".lines # => ["hello\n", "world\n"]
"hello\nworld\n".lines(chomp: true) # => ["hello", "world"]
//}
@param rs 行末を示す文字列
@param chomp 分割した各行に対して String#chomp と同等の結果を得......省略した場合は false を指定したとみなされます。
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# [](regexp , nth = 0) -> String (9283.0) -
正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。 nth を省略したときや 0 の場合は正規表現がマッチした部分文字列全体を返します。 正規表現が self にマッチしなかった場合や nth に対応する括弧がないときは nil を返します。
...情報が組み込み変数 $~ に設定されます。
@param regexp 取得したい文字列のパターンを示す正規表現
@param nth 取得したい正規表現レジスタのインデックス。整数
//emlist[例][ruby]{
p "foobar"[/bar/] # => "bar"
p $~.begin(0) # => 3... -
String
# slice(regexp , nth = 0) -> String (9283.0) -
正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。 nth を省略したときや 0 の場合は正規表現がマッチした部分文字列全体を返します。 正規表現が self にマッチしなかった場合や nth に対応する括弧がないときは nil を返します。
...情報が組み込み変数 $~ に設定されます。
@param regexp 取得したい文字列のパターンを示す正規表現
@param nth 取得したい正規表現レジスタのインデックス。整数
//emlist[例][ruby]{
p "foobar"[/bar/] # => "bar"
p $~.begin(0) # => 3... -
String
# chop -> String (9280.0) -
文字列の最後の文字を取り除いた新しい文字列を生成して返します。 ただし、文字列の終端が "\r\n" であればその 2 文字を取り除きます。
...ばその 2 文字を取り除きます。
//emlist[例][ruby]{
p "string\n".chop # => "string"
p "string\r\n".chop # => "string"
p "string".chop # => "strin"
p "strin".chop # => "stri"
p "".chop # => ""
//}
@see String#chomp
@see String#chop!
@see String#delete_suffix... -
String
# crypt(salt) -> String (9280.0) -
self と salt から暗号化された文字列を生成して返します。 salt には英数字、ドット (「.」)、スラッシュ (「/」) から構成される、 2 バイト以上の文字列を指定します。
...くランダムな文字列を選ぶべきです。
他にも 29297 などがあります。
注意:
* Ruby 2.6 から非推奨になったため、引き続き必要な場合は
string-crypt gem の使用を検討してください。
* crypt の処理は crypt(3) の実装に依存して......
@param salt 文字列を暗号化するための鍵となる文字列。
英数字・「.」・「/」のいずれかで構成される 2 バイト以上の文字列
//emlist[例][ruby]{
# パスワードの暗号化
salt = [rand(64),rand(64)].pack("C*").tr("\x00-\x3f","A-Za-z0-9.... -
String
# upcase(*options) -> String (9280.0) -
全ての小文字を対応する大文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...のエンコーディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}
@see String#upcase!, String#downcase,
String#swapcase, String#capitalize... -
String
# [](substr) -> String | nil (9278.0) -
self が substr を含む場合、一致した文字列を新しく作って返します。 substr を含まなければ nil を返します。
...した文字列を新しく作って返します。
substr を含まなければ nil を返します。
@param substr 取得したい文字列のパターン。文字列
//emlist[例][ruby]{
substr = "bar"
result = "foobar"[substr]
p result # => "bar"
p substr.equal?(result) # => false
//}... -
String
# slice(substr) -> String | nil (9278.0) -
self が substr を含む場合、一致した文字列を新しく作って返します。 substr を含まなければ nil を返します。
...した文字列を新しく作って返します。
substr を含まなければ nil を返します。
@param substr 取得したい文字列のパターン。文字列
//emlist[例][ruby]{
substr = "bar"
result = "foobar"[substr]
p result # => "bar"
p substr.equal?(result) # => false
//}...