ライブラリ
- ビルトイン (2985)
- abbrev (12)
- benchmark (48)
- bigdecimal (72)
-
bigdecimal
/ util (24) -
cgi
/ core (12) -
cgi
/ html (348) - csv (72)
- date (12)
- dbm (120)
- digest (60)
- drb (60)
-
drb
/ extservm (12) - erb (56)
- forwardable (48)
- gdbm (120)
-
irb
/ cmd / help (12) -
irb
/ context (180) -
irb
/ ext / save-history (12) -
irb
/ input-method (72) - json (96)
-
json
/ add / bigdecimal (12) -
json
/ add / exception (12) -
json
/ add / symbol (12) - kconv (48)
- logger (12)
-
minitest
/ unit (1) - mkmf (108)
-
net
/ ftp (12) -
net
/ http (108) -
net
/ imap (564) -
net
/ pop (36) -
net
/ smtp (12) -
net
/ telnet (2) - openssl (348)
- optparse (324)
- pathname (48)
- pp (36)
- psych (60)
- rake (96)
-
rake
/ packagetask (12) -
rdoc
/ code _ object (36) -
rdoc
/ markup (12) -
rdoc
/ text (12) -
rdoc
/ top _ level (12) - resolv (36)
-
rexml
/ document (228) -
ripper
/ lexer (24) -
rubygems
/ builder (24) -
rubygems
/ commands / build _ command (24) -
rubygems
/ gem _ path _ searcher (12) -
rubygems
/ installer (36) -
rubygems
/ specification (84) -
rubygems
/ uninstaller (12) - sdbm (132)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - socket (108)
- stringio (314)
- strscan (180)
- uri (12)
-
webrick
/ httpauth / authenticator (12) -
webrick
/ httpauth / basicauth (12) -
webrick
/ httpauth / digestauth (24) -
webrick
/ httpauth / htdigest (12) -
webrick
/ httpauth / htgroup (12) -
webrick
/ httpauth / htpasswd (24) -
webrick
/ httpauth / userdb (24) -
webrick
/ httprequest (276) -
webrick
/ httpresponse (120) -
webrick
/ httputils (72) -
webrick
/ httpversion (12) -
webrick
/ log (24) -
win32
/ registry (12) - win32ole (144)
-
yaml
/ dbm (96) - zlib (288)
クラス
-
ARGF
. class (84) - Array (33)
- BasicObject (12)
- BasicSocket (72)
-
Benchmark
:: Job (12) -
Benchmark
:: Tms (36) - BigDecimal (96)
- Bignum (6)
- Binding (7)
-
CSV
:: Table (72) - Class (12)
- DBM (120)
-
DRb
:: DRbObject (12) -
DRb
:: DRbRemoteError (12) -
DRb
:: DRbServer (12) -
DRb
:: DRbUnknown (24) -
DRb
:: ExtServManager (12) - Date (12)
-
Digest
:: Base (60) - ERB (56)
- Encoding (12)
-
Encoding
:: Converter (72) -
Encoding
:: InvalidByteSequenceError (36) - Enumerator (24)
- Exception (44)
- Fixnum (6)
- GDBM (120)
-
Gem
:: Builder (24) -
Gem
:: Commands :: BuildCommand (24) -
Gem
:: GemPathSearcher (12) -
Gem
:: Installer (36) -
Gem
:: Specification (84) -
Gem
:: Uninstaller (12) - IO (104)
-
IRB
:: Context (192) -
IRB
:: ExtendCommand :: Help (12) -
IRB
:: FileInputMethod (12) -
IRB
:: InputMethod (12) -
IRB
:: ReadlineInputMethod (24) -
IRB
:: StdioInputMethod (24) - Integer (24)
-
JSON
:: State (60) - Logger (12)
- MatchData (24)
- Method (12)
- Module (448)
-
Net
:: FTP (12) -
Net
:: HTTP (12) -
Net
:: HTTPGenericRequest (12) -
Net
:: HTTPResponse (48) -
Net
:: IMAP (36) -
Net
:: IMAP :: Address (12) -
Net
:: IMAP :: BodyTypeBasic (108) -
Net
:: IMAP :: BodyTypeMessage (108) -
Net
:: IMAP :: BodyTypeMultipart (60) -
Net
:: IMAP :: BodyTypeText (108) -
Net
:: IMAP :: Envelope (12) -
Net
:: IMAP :: FetchData (12) -
Net
:: IMAP :: MailboxACLItem (24) -
Net
:: IMAP :: MailboxList (36) -
Net
:: IMAP :: MailboxQuota (12) -
Net
:: IMAP :: MailboxQuotaRoot (24) -
Net
:: IMAP :: StatusData (12) -
Net
:: POPMail (36) -
Net
:: SMTP (12) -
Net
:: Telnet (2) - Object (309)
-
OpenSSL
:: ASN1 :: ObjectId (60) -
OpenSSL
:: BN (12) -
OpenSSL
:: PKCS7 (12) -
OpenSSL
:: PKey :: DH (24) -
OpenSSL
:: PKey :: DSA (12) -
OpenSSL
:: PKey :: EC (12) -
OpenSSL
:: PKey :: RSA (36) -
OpenSSL
:: SSL :: SSLSocket (12) -
OpenSSL
:: X509 :: Attribute (24) -
OpenSSL
:: X509 :: Extension (12) -
OpenSSL
:: X509 :: ExtensionFactory (12) -
OpenSSL
:: X509 :: StoreContext (12) - OptionParser (264)
-
OptionParser
:: ParseError (12) - Pathname (48)
-
Psych
:: Nodes :: Node (12) -
Psych
:: ScalarScanner (12) -
Psych
:: SyntaxError (12) -
RDoc
:: CodeObject (36) -
RDoc
:: Markup (12) -
RDoc
:: Options (12) -
RDoc
:: TopLevel (12) -
REXML
:: Attribute (72) -
REXML
:: Attributes (36) -
REXML
:: Comment (12) -
REXML
:: DocType (24) -
REXML
:: Element (60) -
REXML
:: Entity (12) -
REXML
:: NotationDecl (12) -
Rake
:: FileList (84) -
Rake
:: PackageTask (12) - Random (12)
- Range (19)
- Regexp (12)
-
Resolv
:: DNS :: Resource :: IN :: WKS (12) -
Resolv
:: DNS :: Resource :: MINFO (24) -
Ripper
:: Lexer (24) -
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (94) - SDBM (132)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - Socket (24)
- String (1097)
- StringIO (314)
- StringScanner (180)
- Struct (24)
- Symbol (395)
- Thread (56)
-
Thread
:: Backtrace :: Location (72) - Time (12)
- UDPSocket (12)
-
URI
:: LDAP (12) - UnboundMethod (96)
-
WEBrick
:: Cookie (120) -
WEBrick
:: HTTPAuth :: BasicAuth (12) -
WEBrick
:: HTTPAuth :: DigestAuth (24) -
WEBrick
:: HTTPAuth :: Htdigest (12) -
WEBrick
:: HTTPAuth :: Htgroup (12) -
WEBrick
:: HTTPAuth :: Htpasswd (24) -
WEBrick
:: HTTPRequest (276) -
WEBrick
:: HTTPResponse (120) -
WEBrick
:: HTTPUtils :: FormData (72) -
WEBrick
:: HTTPVersion (12) -
WEBrick
:: Log (24) -
WIN32OLE
_ TYPELIB (60) -
WIN32OLE
_ VARIABLE (60) -
WIN32OLE
_ VARIANT (24) -
Win32
:: Registry (12) -
YAML
:: DBM (96) -
Zlib
:: Deflate (60) -
Zlib
:: GzipFile (36) -
Zlib
:: GzipFile :: Error (24) -
Zlib
:: GzipReader (60) -
Zlib
:: GzipWriter (12) -
Zlib
:: Inflate (60) -
Zlib
:: ZStream (36)
モジュール
-
CGI
:: HtmlExtension (348) -
CGI
:: QueryExtension (12) - Forwardable (24)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) - Kernel (108)
-
MiniTest
:: Assertions (1) -
Net
:: HTTPHeader (36) -
OpenSSL
:: Buffering (108) -
OptionParser
:: Arguable (48) -
RDoc
:: Text (12) - SingleForwardable (24)
-
WEBrick
:: HTTPAuth :: Authenticator (12) -
WEBrick
:: HTTPAuth :: UserDB (24)
キーワード
- % (12)
- + (12)
- << (36)
- <=> (12)
- == (36)
- === (48)
- =~ (21)
- [] (264)
- []= (36)
-
_ _ drburi (12) -
_ _ id _ _ (12) -
_ _ inspect _ _ (12) -
_ _ to _ s _ _ (12) -
_ dump (24) - abbrev (12)
- abort (12)
-
absolute
_ path (24) - accept (12)
-
accept
_ charset (12) -
accept
_ encoding (12) -
accept
_ language (12) -
add
_ special (12) - algorithm (12)
-
alias
_ method (4) - all (12)
-
ap
_ name (12) -
ap
_ name= (12) -
arg
_ config (12) - arguments (12)
- arity (12)
-
ascii
_ only? (12) - attr (36)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) -
attribute
_ of (12) - attributes (12)
- backtrace (24)
- base (12)
-
base
_ label (24) - basename (18)
-
basic
_ auth (12) -
beginning
_ of _ line? (12) -
bin
_ dir (24) - bind (12)
- bindir (12)
- binmode (12)
- binread (12)
- binwrite (12)
- bitmap (12)
- blockquote (24)
- body (60)
- bol? (12)
- buf (12)
- build (12)
- byteindex (3)
- byterindex (3)
- bytes (50)
- bytesize (12)
- byteslice (36)
- bytesplice (10)
- capability (12)
-
capable
_ auth _ types (12) - capitalize (12)
- casecmp (12)
- casecmp? (18)
- chars (12)
- checkbox (24)
-
checkbox
_ group (24) - class (12)
-
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) - clone (24)
- closed? (12)
-
closed
_ read? (12) -
closed
_ write? (12) - codepoints (12)
- coerce (12)
- comment (36)
- comment= (24)
-
compute
_ key (12) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) -
content
_ id (36) -
content
_ length (12) -
content
_ length= (12) -
content
_ type (24) - convert (12)
- cover? (19)
-
create
_ body (12) -
create
_ extension (12) -
default
_ executable (12) -
define
_ method (24) -
define
_ singleton _ method (24) - deflate (12)
- delegate (24)
- delete (24)
-
delete
_ passwd (12) - delim (12)
- description (36)
-
destination
_ encoding _ name (12) -
dh
_ compute _ key (12) - digest (12)
- digest! (12)
- disasm (12)
- disassemble (12)
- domain (12)
- domain= (12)
- downcase (12)
- dummy? (12)
- dump (12)
- dup (12)
-
each
_ byte (48) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ grapheme _ cluster (8) -
each
_ key (12) - emailbx (12)
- empty? (36)
-
enable
_ config (24) - encode (36)
- encoding (48)
-
end
_ with? (18) - entity (12)
- eof (12)
- eof? (12)
- eos? (12)
- eql? (24)
-
error
_ bytes (12) - executable (12)
- executables (12)
- execute (12)
- fetch (12)
-
file
_ absolute _ name (12) -
file
_ field (12) -
file
_ name (12) - filename (36)
- filename= (24)
-
find
_ executable (12) - finish (48)
- flush (12)
-
flush
_ next _ in (12) -
flush
_ next _ out (12) - form (24)
- format (12)
- formatter (12)
- freeze (12)
- generate (12)
-
get
_ byte (12) -
get
_ passwd (36) - getbyte (36)
- getc (24)
- getch (12)
- getpeername (12)
- gets (60)
- getsockname (12)
-
grapheme
_ clusters (8) - gsub (60)
- gsub! (60)
- guid (12)
- hash (12)
- hexdigest (12)
- hexdigest! (12)
- hidden (12)
-
history
_ file (12) - host (12)
- html (24)
- id2name (12)
- img (12)
- include? (12)
- index (48)
- inflate (12)
- input (12)
-
insert
_ output (12) - inspect (163)
-
instance
_ delegate (12) -
instance
_ method (12) - intern (24)
- invert (12)
-
irb
_ name (12) -
irb
_ name= (12) -
irb
_ path (12) -
is
_ a? (12) - iseuc (12)
- isjis (12)
- issjis (12)
- isutf8 (12)
- itself (12)
-
json
_ creatable? (12) - key (48)
- keys (36)
-
kind
_ of? (12) - label (36)
- language (48)
- length (12)
- lex (12)
-
lib
_ dirs _ for (12) -
lib
_ files (12) - libpathflag (12)
-
library
_ name (12) - line (24)
-
link
_ command (12) - list (12)
- ln (12)
-
load
_ modules (12) -
long
_ name (12) - mail (12)
- mailbox (48)
-
make
_ passwd (12) - match (24)
- match? (30)
- matched? (12)
-
matched
_ size (12) - md5 (36)
-
media
_ subtype (48) -
media
_ type (48) - members (12)
-
merge
_ libs (12) - method (12)
-
method
_ defined? (12) -
module
_ function (12) -
mu
_ pp (1) -
multipart
_ form (24) - name (101)
- name= (12)
- namespace (24)
- namespaces (24)
- next (24)
- next! (12)
-
object
_ nl (12) -
object
_ nl= (12) - oct (12)
- oid (24)
-
ole
_ type (12) -
ole
_ type _ detail (12) - on (144)
- order (48)
- order! (48)
-
orig
_ name (12) - pack (21)
- param (48)
- params (36)
-
parent
_ file _ name (12) -
parent
_ name (12) - parse (12)
- parse! (12)
-
password
_ field (12) - path (72)
- path= (12)
-
path
_ info (12) - pathmap (12)
- peek (12)
- peep (12)
- permute (24)
- permute! (24)
- pop (12)
- port (12)
- pread (8)
- prefix (12)
- prefixes (24)
-
pretty
_ inspect (12) -
pretty
_ print _ inspect (12) -
pretty
_ print _ instance _ variables (12) - print (12)
- printf (12)
- private (48)
-
private
_ method _ defined? (12) - problem (12)
-
prompt
_ c (12) -
prompt
_ i (12) -
prompt
_ n (12) -
prompt
_ s (12) - protected (12)
-
protected
_ method _ defined? (12) -
proxy
_ basic _ auth (12) -
psych
_ to _ yaml (12) - pubid (12)
- public (72)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ decrypt (12) -
public
_ encrypt (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) - putback (24)
- putc (24)
- puts (12)
- qop (12)
- query (12)
-
query
_ string (12) -
query
_ string= (12) - quotaroots (12)
-
radio
_ group (12) -
raw
_ header (12) - read (48)
-
read
_ body (24) -
read
_ nonblock (48) -
readagain
_ bytes (12) - readbyte (12)
- readchar (12)
- readline (24)
- readlines (12)
- readpartial (60)
- realm (24)
- reason (12)
-
reason
_ phrase (12) - recv (12)
-
recv
_ nonblock (12) -
recvfrom
_ nonblock (24) - recvmsg (12)
-
recvmsg
_ nonblock (12) - reject (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) - replacement= (12)
-
request
_ line (12) -
request
_ method (24) - reset (12)
- responses (12)
- rest? (12)
- result (12)
-
result
_ with _ hash (8) -
return
_ format (12) - rights (12)
- rmailbx (12)
-
rubygems
_ version (12) - scan (24)
-
scan
_ full (12) -
script
_ name (12) -
scrolling
_ list (12) - scrub (36)
- scrub! (36)
-
search
_ full (12) - select (48)
-
server
_ name (12) -
set
_ backtrace (24) -
set
_ dictionary (24) -
set
_ encoding (72) - setbyte (12)
- shebang (12)
- shift (48)
-
short
_ name (12) -
single
_ delegate (12) -
singleton
_ class (12) -
singleton
_ method (12) - size (12)
- slice (132)
- slice! (12)
- sn (12)
-
source
_ location (19) -
space
_ before (12) -
space
_ before= (12) - split (31)
- src (12)
-
ssl
_ version (12) -
start
_ with? (18) - status (24)
-
status
_ line (12) - store (36)
- strftime (24)
- string= (12)
- sub (72)
- sub! (48)
-
sub
_ type (12) - subject (12)
- submit (24)
- subtype (48)
- succ (24)
- succ! (12)
- success (12)
- sum (12)
- swapcase (12)
- sync (12)
- sync= (12)
- sysread (36)
- syswrite (12)
- tag (12)
- tainted? (6)
-
tar
_ bz2 _ file (12) - text (12)
-
text
_ field (12) - textarea (12)
- then (14)
-
thread
_ variable? (12) -
time
_ format (12) -
time
_ format= (12) -
to
_ a (48) -
to
_ binary (10) -
to
_ csv (12) -
to
_ d (12) -
to
_ der (12) -
to
_ digits (12) -
to
_ i (12) -
to
_ json (48) -
to
_ json _ raw _ object (12) -
to
_ ruby (12) -
to
_ s (296) -
to
_ str (12) -
to
_ string (12) -
to
_ sym (24) -
to
_ yaml (12) - tokenize (12)
-
undef
_ method (12) - ungetbyte (12)
- ungetc (12)
-
unicode
_ normalized? (11) - unpack (12)
- unpack1 (9)
-
unparsed
_ uri (12) - unused (12)
- upcase (12)
- upto (12)
- uri (24)
- usage (12)
- user (24)
-
valid
_ encoding? (12) - value (36)
- value= (12)
- values (36)
-
values
_ at (48) -
variable
_ kind (12) - verify (24)
- waitfor (2)
- webcvs (12)
-
windows
_ stub _ script (12) -
with
_ config (24) -
with
_ object (24) - write (12)
-
write
_ nonblock (24) - xpath (24)
-
yield
_ self (16)
検索結果
先頭5件
-
String
# sub!(pattern , hash) -> String (15218.0) -
文字列中の pattern にマッチした部分をキーにして hash を引いた値で破壊的に置き換えます。
文字列中の pattern にマッチした部分をキーにして hash を引いた値で破壊的に置き換えます。
@param pattern 置き換える文字列のパターン
@param hash 置き換える文字列を与えるハッシュ
@return 置換した場合は self、置換しなかった場合は nil -
String
# bytesplice(index , length , str) -> String (15217.0) -
self の一部または全部を str で置き換えて self を返します。
...r.byteslice(str_index, str_length) もしくは str.byteslice(str_range) で置き換えます。
ただし、str の部分文字列は新しい文字列オブジェクトとして生成されません。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#by......r_range str の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(index , length , str , str _ index , str _ length) -> String (15217.0) -
self の一部または全部を str で置き換えて self を返します。
...r.byteslice(str_index, str_length) もしくは str.byteslice(str_range) で置き換えます。
ただし、str の部分文字列は新しい文字列オブジェクトとして生成されません。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#by......r_range str の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(range , str) -> String (15217.0) -
self の一部または全部を str で置き換えて self を返します。
...r.byteslice(str_index, str_length) もしくは str.byteslice(str_range) で置き換えます。
ただし、str の部分文字列は新しい文字列オブジェクトとして生成されません。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#by......r_range str の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(range , str , str _ range) -> String (15217.0) -
self の一部または全部を str で置き換えて self を返します。
...r.byteslice(str_index, str_length) もしくは str.byteslice(str_range) で置き換えます。
ただし、str の部分文字列は新しい文字列オブジェクトとして生成されません。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#by......r_range str の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(index , length , str) -> String (15215.0) -
self の一部または全部を str で置き換えて self を返します。
...は全部を str で置き換えて self を返します。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@pa......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(range , str) -> String (15215.0) -
self の一部または全部を str で置き換えて self を返します。
...は全部を str で置き換えて self を返します。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@pa......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# byteslice(nth) -> String | nil (15214.0) -
nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。
...rn 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0) # => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}
@see String#slice... -
String
# bytes {|byte| . . . } -> self (15213.0) -
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
...h_byte.to_a と同じです)
//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}
ブロックが指定された場合は String#each_byte と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#......each_byte... -
String
# byteslice(nth) -> String | nil (15212.0) -
nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。
...rn 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0) # => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}
@see String#slice... -
String
# byteslice(nth , len=1) -> String | nil (15212.0) -
nth バイト目から長さ len バイトの部分文字列を新しく作って返します。 nth が負の場合は文字列の末尾から数えます。引数が範囲外を指定した場合は nil を返します。
...数で指定します。
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1, 2) # => "el"
"\u3042\u3044\u3046".byteslice(0, 3) # => "\u3042"
//}
@see String#slice... -
String
# byteslice(range) -> String | nil (15212.0) -
range で指定したバイトの範囲に含まれる部分文字列を返します。引数が範囲 外を指定した場合は nil を返します。
...を示す Range オブジェクト
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1..2) # => "el"
"\x03\u3042\xff".byteslice(1..3) # => "\u3042"
//}
@see String#slice... -
String
# scrub -> String (15210.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!... -
String
# scrub {|bytes| . . . } -> String (15210.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!... -
String
# scrub! -> String (15210.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に 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... -
String
# scrub! {|bytes| . . . } -> String (15210.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に 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...