name = "report.txt" puts name.start_with?("rep") # several candidates can be checked at once puts name.end_with?(".txt", ".md")
prefix and suffix tests