Top "Tryparse" questions

Converts the string representation of an object to its typed equivalent.

DateTime.TryParse issue with dates of yyyy-dd-MM format

I have the following date in string format "2011-29-01 12:00 am" . Now I am trying to convert that to datetime …

c# asp.net datetime date tryparse
In C#, how to check whether a string contains an integer?

I just want to know, whether a String variable contains a parsable positive integer value. I do NOT want to …

c# string parsing integer tryparse
How do you test your Request.QueryString[] variables?

I frequently make use of Request.QueryString[] variables. In my Page_load I often do things like: int id = -1; …

c# coding-style tryparse isnumeric request.querystring
Parse v. TryParse

What is the difference between Parse() and TryParse()? int number = int.Parse(textBoxNumber.Text); // The Try-Parse Method int.TryParse(textBoxNumber.…

c# parsing integer tryparse
Generic TryParse

I am trying to create a generic extension that uses 'TryParse' to check if a string is a given type: …

c# generics tryparse
Integer.TryParse - a better way?

I find myself often needing to use Integer.TryParse to test if a value is an integer. However, when you …

vb.net tryparse
Culture invariant Decimal.TryParse()

I'm writing a custom string to decimal validator that needs to use Decimal.TryParse that ignores culture (i.e. doesn't …

c# decimal cultureinfo tryparse
Format a number to display a comma when larger than a thousand

I am writing some code in Visual Basic.net and have a question. If I have a long number, that …

vb.net string long-integer number-formatting tryparse
int.TryParse = null if not numeric?

is there some way of return null if it can't parse a string to int? with: public .... , string? categoryID) { int.…

c# .net tryparse
What is wrong on this Decimal.TryParse?

Code : Decimal kilometro = Decimal.TryParse(myRow[0].ToString(), out decimal 0); some arguments are not valid?

c# tryparse