update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
|
|
@ -1,9 +1,10 @@
|
|||
str = 'abcdefgh'
|
||||
n = 2
|
||||
m = 3
|
||||
puts str[n, m]
|
||||
puts str[n..-1]
|
||||
puts str[0..-2]
|
||||
puts str[str.index('d'), m]
|
||||
puts str[str.index('de'), m]
|
||||
puts str[/a.*d/]
|
||||
puts str[n, m] #=> cde
|
||||
puts str[n..m] #=> cd
|
||||
puts str[n..-1] #=> cdefgh
|
||||
puts str[0..-2] #=> abcdefg
|
||||
puts str[str.index('d'), m] #=> def
|
||||
puts str[str.index('de'), m] #=> def
|
||||
puts str[/a.*d/] #=> abcd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue