Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SafeParse() for value types #31

Open
hanssens opened this issue Oct 26, 2016 · 0 comments
Open

Add SafeParse() for value types #31

hanssens opened this issue Oct 26, 2016 · 0 comments
Labels
Milestone

Comments

@hanssens
Copy link
Owner

Requires no further introduction; the TryParse function is quite cumbersome, due to the out ref:

public int GetValue(string numberAsText) {
    int value;
    int.TryParse(numberAsText, out value);
    return value;
}

In C# 7 we might get rid of this. But until then - and for backwards compatibility - this is still cumbersome and a SafeParse() for these value types would be a clean solution.

@hanssens hanssens added this to the Roadmap milestone Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant