RosettaCodeData/Task/Regular-expressions/Ruby/regular-expressions-1.rb

4 lines
116 B
Ruby
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
str = "I am a string"
p "Ends with 'string'" if str =~ /string$/
p "Does not start with 'You'" unless str =~ /^You/