Ruby provides straightforward methods for string manipulation, including capitalization.
In Ruby, you can concatenate strings with the + operator or the << method, which modifies the string in place.
+
<<
Historically, case conversion has been a staple in programming languages to ensure text uniformity.
Historically, Ruby has been a language with a strong focus on text processing, inheriting some of its philosophies from Perl.
Ruby makes extracting substrings simple.
Ruby keeps it simple with the .length method.
.length
In Ruby, you wrap your variable or expression in #{} and plunk it down where you want it in a double-quoted string.
#{}
Ruby’s got some neat tricks up its sleeve for snipping out those pesky quotation marks.
Ruby makes it easy. Use gsub to globally substitute text, or sub for a single instance. Here’s a quick look.
gsub
sub
To match a string against a simple pattern, you can use the match method.
match