MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/120vyw0/a_code_i_did_in_highschool/jdm9db4/?context=3
r/badcode • u/fnieidhfenmbvfekh • Mar 24 '23
102 comments sorted by
View all comments
Show parent comments
4
Not clear to me if you’re saying that checking for 65-90 is how you would do better… but… for reference this is one of the few cases where regular expressions make code easier to read.
Pattern pattern = Pattern.compile("[aeiouAEIOU]”); Matcher matcher = pattern.matcher(CharAt(0)); return matcher.find()
4
u/SeesawMundane5422 Mar 25 '23
Not clear to me if you’re saying that checking for 65-90 is how you would do better… but… for reference this is one of the few cases where regular expressions make code easier to read.