Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jcasimir
Created February 8, 2012 21:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcasimir/1774025 to your computer and use it in GitHub Desktop.
Save jcasimir/1774025 to your computer and use it in GitHub Desktop.

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