Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created December 3, 2012 14:48
Show Gist options
  • Save workmad3/4195446 to your computer and use it in GitHub Desktop.
Save workmad3/4195446 to your computer and use it in GitHub Desktop.
String < Object
------------------------------------------------------------------------------
Includes:
Comparable (from ruby core)
(from ruby core)
------------------------------------------------------------------------------
A String object holds and manipulates an arbitrary sequence of bytes,
typically representing characters. String objects may be created using
String::new or as literals.
Because of aliasing issues, users of strings should be aware of the methods
that modify the contents of a String object. Typically, methods with
names ending in ``!'' modify their receiver, while those without a ``!''
return a new String. However, there are exceptions, such as
String#[]=.
Rake extension methods for String.
------------------------------------------------------------------------------
Class methods:
new
try_convert
Instance methods:
%
*
+
<<
<=>
==
===
=~
[]
[]=
ascii_only?
block_scanf
bytes
bytesize
byteslice
capitalize
capitalize!
casecmp
center
chars
chomp
chomp!
chop
chop!
chr
clear
codepoints
concat
count
crypt
delete
delete!
downcase
downcase!
dump
each_byte
each_char
each_codepoint
each_line
empty?
encode
encode!
encoding
end_with?
eql?
ext
force_encoding
getbyte
gsub
gsub!
hash
hex
include?
index
initialize_copy
insert
inspect
intern
iseuc
isjis
issjis
isutf8
kconv
length
lines
ljust
lstrip
lstrip!
match
next
next!
oct
ord
parse_csv
partition
pathmap
pathmap_explode
pathmap_partial
pathmap_replace
prepend
replace
reverse
reverse!
rindex
rjust
rpartition
rstrip
rstrip!
scan
scanf
setbyte
shellescape
shellsplit
size
slice
slice!
split
squeeze
squeeze!
start_with?
strip
strip!
sub
sub!
succ
succ!
sum
swapcase
swapcase!
to_c
to_d
to_f
to_i
to_r
to_s
to_str
to_sym
toeuc
tojis
tolocale
tosjis
toutf16
toutf32
toutf8
tr
tr!
tr_s
tr_s!
unpack
upcase
upcase!
upto
valid_encoding?
From: string.c @ line N/A:
A <code>String</code> object holds and manipulates an arbitrary sequence of
bytes, typically representing characters. String objects may be created
using <code>String::new</code> or as literals.
Because of aliasing issues, users of strings should be aware of the methods
that modify the contents of a <code>String</code> object. Typically,
methods with names ending in ``!'' modify their receiver, while those
without a ``!'' return a new <code>String</code>. However, there are
exceptions, such as <code>String#[]=</code>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment