Strings in Ruby Discussion
Discussion for
Strings in Ruby
Awesome! Thanks Collin! Looking forward to reviewing 'String' instance methods!
(https://ruby-doc.org/3.2.2/String.html)
I appreciate your focus on good terminology! : )
Summary of Topics:
- Single and double quotes
- Escaping characters
- Interpolation
- String class vs String literals
- Concatenation
- String instance methods with arguments
- String predicate methods => returns a boolean response
- Method chaining
- String indexing (zero-based indexing)
In this lesson you tell about brackets usage for better understanding that methods take arguments.
puts "text".count "a" - looks like syntax sugar, and it seems like this can lead to misunderstanding in the future.
Does it make sense to do it like in the following example instead?
puts( "text".count( "a" ) )