My take on the answer

Very similar to other solutions offered
 - uses match with regex instead of string offers a simpler working solution.
 - mild stylistic changes