Skip to content

Instantly share code, notes, and snippets.

@MadsTorgersen
Created March 9, 2017 20:32
if (o is int i || (o is string s && int.TryParse(s, out i)) { /* use i */ }
@leparduk
Copy link

Should have an extra bracket

if (o is int i || (o is string s && int.TryParse(s, out i))) { /* use i */ }

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment