Artwork

A tartalmat a Andrew Mason and Julie J biztosítja. Az összes podcast-tartalmat, beleértve az epizódokat, grafikákat és podcast-leírásokat, közvetlenül a Andrew Mason and Julie J vagy a podcast platform partnere tölti fel és biztosítja. Ha úgy gondolja, hogy valaki az Ön engedélye nélkül használja fel a szerzői joggal védett művét, kövesse az itt leírt folyamatot https://hu.player.fm/legal.
Player FM - Podcast alkalmazás
Lépjen offline állapotba az Player FM alkalmazással!

Favorite Ruby Methods: Part 3 - Strings

22:32
 
Megosztás
 

Manage episode 355549096 series 3375882
A tartalmat a Andrew Mason and Julie J biztosítja. Az összes podcast-tartalmat, beleértve az epizódokat, grafikákat és podcast-leírásokat, közvetlenül a Andrew Mason and Julie J vagy a podcast platform partnere tölti fel és biztosítja. Ha úgy gondolja, hogy valaki az Ön engedélye nélkül használja fel a szerzői joggal védett művét, kövesse az itt leírt folyamatot https://hu.player.fm/legal.

On this episode of Ruby for All, Andrew and Julie are having an ADHD day since Andrew’s had a lot going on with work stuff and Julie’s been hyperfocused learning about the mobile app. But that won’t stop them from discussing their favorite Ruby Methods. Today, they’re excited to talk about the basics of Strings in programming because Andrew loves a good string. They’ll be discussing the Ruby Methods chomp, strip, split, valid_encoding, sub, gsub, slice, delete_prefix, and swapcase. Although some of these may seem pretty hard to understand, they hope after listening you’ll have a little better understanding of the fundamentals of a String. Go ahead and download this episode now!

[00:01:50] We start with the String method chomp, which returns a new String with the given record separator removed from the end of string. This is one of the first methods Julie learned when she was learning Ruby.

[00:03:37] When does Andrew use chomp? Also, he tells us how strip is different from chomp, and Julie shares an annoying thing about space after the email.

[00:06:26] The next method is split, which divides the string into substrings based on a delimiter, returning an array of these substrings. Andrew shares an example.

[00:10:21] On to method valid encoding, where Andrew explains why the valid encoding we want in Ruby is UTF-8, and he tells us how they were getting errors in their error monitoring service in Honeybadger.

[00:13:21] Moving on to the next method sub, which returns a copy of self with only the first occurrence (not all occurrences) of the given pattern replaced. Julie gives us a great example.

[00:14:22] The next method is gsub, which Andrew uses more than sub, and we find out how gsub is different from sub and the main difference being it replaces all occurrences. Andrew mentions a great article to read (link below) that talks about gsub with a block.

[00:15:49] Our next method is slice, which returns the substring of self, specified by the arguments, and Julie mentions that string slice is an alias for string brackets and Andrew did not know that! Does Andrew use slice or bracket?

[00:18:39] Delete_prefix is the next method and a little easier to understand. It returns a copy of string with leading prefix deleted. Andrew gives an example.

[00:20:38] Julie really likes the last method which is swapcase. Why does she like it? Andrew thinks it’s one of those fun Ruby methods.

Panelists:

Andrew Mason

Julie J.

Sponsors:

GoRails

Honeybadger

Links:

Andrew Mason Twitter

Andrew Mason Website

Julie J. Twitter

Julie J. Website

chomp

strip

split

valid_encoding

sub

gsub

Using Ruby’s gsub with a block-Bozhidar Batsov

slice

delete_prefix

swapcase

  continue reading

67 epizódok

Artwork

Favorite Ruby Methods: Part 3 - Strings

Ruby for All

15 subscribers

published

iconMegosztás
 
Manage episode 355549096 series 3375882
A tartalmat a Andrew Mason and Julie J biztosítja. Az összes podcast-tartalmat, beleértve az epizódokat, grafikákat és podcast-leírásokat, közvetlenül a Andrew Mason and Julie J vagy a podcast platform partnere tölti fel és biztosítja. Ha úgy gondolja, hogy valaki az Ön engedélye nélkül használja fel a szerzői joggal védett művét, kövesse az itt leírt folyamatot https://hu.player.fm/legal.

On this episode of Ruby for All, Andrew and Julie are having an ADHD day since Andrew’s had a lot going on with work stuff and Julie’s been hyperfocused learning about the mobile app. But that won’t stop them from discussing their favorite Ruby Methods. Today, they’re excited to talk about the basics of Strings in programming because Andrew loves a good string. They’ll be discussing the Ruby Methods chomp, strip, split, valid_encoding, sub, gsub, slice, delete_prefix, and swapcase. Although some of these may seem pretty hard to understand, they hope after listening you’ll have a little better understanding of the fundamentals of a String. Go ahead and download this episode now!

[00:01:50] We start with the String method chomp, which returns a new String with the given record separator removed from the end of string. This is one of the first methods Julie learned when she was learning Ruby.

[00:03:37] When does Andrew use chomp? Also, he tells us how strip is different from chomp, and Julie shares an annoying thing about space after the email.

[00:06:26] The next method is split, which divides the string into substrings based on a delimiter, returning an array of these substrings. Andrew shares an example.

[00:10:21] On to method valid encoding, where Andrew explains why the valid encoding we want in Ruby is UTF-8, and he tells us how they were getting errors in their error monitoring service in Honeybadger.

[00:13:21] Moving on to the next method sub, which returns a copy of self with only the first occurrence (not all occurrences) of the given pattern replaced. Julie gives us a great example.

[00:14:22] The next method is gsub, which Andrew uses more than sub, and we find out how gsub is different from sub and the main difference being it replaces all occurrences. Andrew mentions a great article to read (link below) that talks about gsub with a block.

[00:15:49] Our next method is slice, which returns the substring of self, specified by the arguments, and Julie mentions that string slice is an alias for string brackets and Andrew did not know that! Does Andrew use slice or bracket?

[00:18:39] Delete_prefix is the next method and a little easier to understand. It returns a copy of string with leading prefix deleted. Andrew gives an example.

[00:20:38] Julie really likes the last method which is swapcase. Why does she like it? Andrew thinks it’s one of those fun Ruby methods.

Panelists:

Andrew Mason

Julie J.

Sponsors:

GoRails

Honeybadger

Links:

Andrew Mason Twitter

Andrew Mason Website

Julie J. Twitter

Julie J. Website

chomp

strip

split

valid_encoding

sub

gsub

Using Ruby’s gsub with a block-Bozhidar Batsov

slice

delete_prefix

swapcase

  continue reading

67 epizódok

Minden epizód

×
 
Loading …

Üdvözlünk a Player FM-nél!

A Player FM lejátszó az internetet böngészi a kiváló minőségű podcastok után, hogy ön élvezhesse azokat. Ez a legjobb podcast-alkalmazás, Androidon, iPhone-on és a weben is működik. Jelentkezzen be az feliratkozások szinkronizálásához az eszközök között.

 

Gyors referencia kézikönyv