`prefer-starts-ends-with`: Remove `string.match`
See original GitHub issueWe are checking string.match(/^a/)
, we should not check it, only /^a/.test(string)
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Remove matched patterns — str_remove • stringr
Use regex() for finer control of the matching behaviour. Match a fixed string (i.e. by comparing only bytes), using fixed() . This is...
Read more >How to remove text from a string? - javascript - Stack Overflow
You can use "data-123".replace('data-',''); , as mentioned, but as replace() only replaces the FIRST instance of the matching text, if your string was ......
Read more >Remove text before, after or between two characters in Excel
Remove text after a specific character. To delete a substring before a comma, type an asterisk, a comma, and a space (*, )...
Read more >How To Remove Characters from a String in Python
Introduction. This article describes two common methods that you can use to remove characters from a string using Python:.
Read more >Remove a part of a string in Python - nkmk note
Remove a substring by replacing it with an empty string · Remove exact match string: replace() · Remove substrings by regex: re.sub().
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
prefer-regexp-test
rule has been added,String#match()
should be removed.A rule that reports
string.match
orregex.exec
used in a conditional/boolean context might nice to have. It should suggestregex.test
for both.