Skip to content

Instantly share code, notes, and snippets.

@knwang
Last active August 29, 2015 14:27
Show Gist options
  • Save knwang/c0fbbf4e751f20b26166 to your computer and use it in GitHub Desktop.
Save knwang/c0fbbf4e751f20b26166 to your computer and use it in GitHub Desktop.

String

::new
*
+
<<
<=>
==
=~
[index]
[start, length]
[range]
[regexp]
[regexp, capture]
ascii_only?
capitalize
capitalize!
chars
chomp
chomp!
chop
chop!
chr
concat
delete
delete!
downcase
downcase!
each_char {|char| ... } 
emtpy?
end_with?
gsub(pattern, replacement)
gsub!(pattern, replacement)
gsub(pattern) {|match| ... }
gsub!(pattern) {|match| ... }
include?
index(substring)
index(regexp)
insert(index, other_string)
length
lines
lstrip
lstrip!
match(pattern)
match(pattern, position)
prepend
reverse
reverse!
rindex(substring)
rindex(regexp)
rstrip
rstrip!
scan(pattern)
scan(pattern) {|match| ... }
size
slice(index)
slice(start, length)
slice(range)
slice(regexp)
slice(regexp, capture)
slice!(index)
slice!(start, length)
slice!(range)
slice!(regexp)
slice!(regexp, capture)
split(pattern)
squeeze
squeeze!
start_with?
strip
strip!
sub(pattern, replacement)
sub(pattern) {|match| ... }
sub!(pattern, replacement)
sub!(pattern) {|match| ... }
to_f
to_i
to_sym
tr
tr!
upcase
upcase!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment