Recent Coded Smorgasbord

Inspired by the Pop-up Potpourri, the examples presented here aren't necessarily "bad" code nor do they imply the miserable failure that we're all used to reading here. The examples are more-or-less fun snippets of code like ones that we've all written at one time or another.

Apr 2012

EvalToInteger, 'gumdrops', and More

by in Coded Smorgasbord on

"I recently found this while going over some code in a Util library used by my project," Ian writes, "clearly, this method makes sure the job gets done."

public static int EvalToInteger(string statement) {
     string s = EvalToString(statement);
     return int.Parse(s.ToString());
}