Checking for prefixes and suffixes: Ruby 1.9 and later : end_with « String « Ruby






Checking for prefixes and suffixes: Ruby 1.9 and later


s = "hello"

s.start_with? "hell" # => true.  Note singular "start" not "starts"
s.end_with? "bells"  # => false

 

Related examples in the same category