From 8f7f7d91564114a69070c5ce4d63dddf09af5844 Mon Sep 17 00:00:00 2001 From: Mateus Pereira Date: Mon, 3 Oct 2022 21:08:05 -0300 Subject: [PATCH] Removes wrong advice concerning `end_with?` --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index eff9bfe..1f7b8d1 100644 --- a/README.md +++ b/README.md @@ -1200,10 +1200,6 @@ longer. For short strings, `String#match?` performs similarly to > Sometimes you cant replace regexp with `start_with?`,
> for example: `"a\nb" =~ /^b/ #=> 2` but `"a\nb" =~ /\Ab/ #=> nil`.
> :warning:
-> You can combine `start_with?` and `end_with?` to replace -> `error.path =~ /^#{path}(\.rb)?$/` to this
-> `error.path.start_with?(path) && error.path.end_with?('.rb', '')`
-> —— @igas [rails/rails#17316](https://github.com/rails/rails/pull/17316) ``` $ ruby -v code/string/start-string-checking-match-vs-start_with.rb