Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

String

Concepts
  • Creating / Definition
  • Single vs. Double Quoted Strings
  • Combining Strings and Other Data
    • Concatenation with +
    • Wrapping in an Array and using join
    • Interpolating
  • Implications of UTF8 encoding and Ruby 1.9
  • Implications of "Normal" and "Bang" method variants
  • Differences between strings and symbols
  • Memory requirements/usage of string creation and manipulation
Essential Methods
  • Core Ruby
    • chomp
    • strip
    • match
    • capitalize / downcase / upcase
    • each_char / chars
    • empty?
    • gsub
    • delete
    • replace
    • reverse
    • split
    • length
    • include?
    • <=>
    • []
    • <<
    • =~
    • to_i / to_f
  • With ActiveSupport
    • titleize
    • humanize
    • parameterize
    • pluralize / singularize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment