Skip to content

Commit

Permalink
slice第二引数は個数
Browse files Browse the repository at this point in the history
  • Loading branch information
kehonda committed Oct 12, 2020
1 parent f658b6d commit 723def8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example_string_slice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
p string
p string.slice!(0,4)
p string

str = "abcdefghijk"
p str[2,4]

p str.slice(2, 4)

0 comments on commit 723def8

Please sign in to comment.