Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/String-matching/Ruby/string-matching.rb
Normal file
10
Task/String-matching/Ruby/string-matching.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
p 'abcd'.start_with?('ab') #returns true
|
||||
p 'abcd'.end_with?('ab') #returns false
|
||||
p 'abab'.include?('bb') #returns false
|
||||
p 'abab'.include?('ab') #returns true
|
||||
p 'abab'['bb'] #returns nil
|
||||
p 'abab'['ab'] #returns "ab"
|
||||
p 'abab'.index('bb') #returns nil
|
||||
p 'abab'.index('ab') #returns 0
|
||||
p 'abab'.index('ab', 1) #returns 2
|
||||
p 'abab'.rindex('ab') #returns 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue