Ruby for All cover image

Favorite Ruby Methods: Part 3 - Strings

Ruby for All

CHAPTER

Do You Use Slice or Bracket?

Strings slice is an alias for a string bracket. So like if you take bar and you use the shorthand, brackets to it will return the R which is the second index of that string because it starts at zero. Well, next we got slice, which returns the substring of self specified by arguments. I would be very curious if any of our listeners do and what the use cases for that are. Yeah, this example I'm looking at that we'll put in the show notes. Like I said, it's very interesting.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner