I should explain that this snippet is from a little client/server math game I'm writing for my kids to practice their math skills. Therefore I know the format of $Problem precisely because I generated it in the game server. That's why I didn't bother with a lot of validation.
What I am looking for is a cool way to convert the string '+' to the operator +.