Top "Tryparse" questions

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

'string' does not contain a definition for 'TryParse'

Having a little trouble working this one out, I'm wanting to store up to 50 movies in an array in order …

c# .net string compiler-errors tryparse
Decimal.TryParse doesn't parse my decimal value

When I tried to convert something like 0.1 (from user in textbox), My value b is always false. bool b = Decimal.…

c# decimal tryparse
Converting exponential number to decimal 1.11111117E+9 - trailing digits become zero

I'm trying to convert and exponential number 1.11111117E+9 which is actually a 10 digit number '1111111111'. When I'm trying to …

c# parsing decimal tryparse exponential
UInt32.TryParse() hex-number not working

For some reason the following C# Console program always outputs: 32 False wtf=0 What am I doing wrong? using System.Collections.…

c# tryparse
C# error CS0165: Use of unassigned local variable - ignoring logic and out reference

After searching around I cant seem to locate why the C# compiler is complaining that the local variable dteDest is …

c# tryparse unassigned-variable
TryParse failing with negative numbers

I'm having a problem getting TryParse to work correctly for me. I have a list of values that I am …

c# tryparse
Make TryParse compatible with comma or dot decimal separator

The problem: Let's assume you are using a dot "." as a decimal separator in your regional setting and have coded …

c# decimal tryparse regional-settings
How to convert to DateTime but have default value if input is blank?

What .NET function will convert to a DateTime but have a default value if input is blank? eg. DateTime dtTest = …

c# .net datetime tryparse
Best (safest) way to convert from double to int

I'm curious as to the best way to convert a double to an int. Runtime safety is my primary concern …

c# type-conversion explicit tryparse
DateTime.TryParseExact not working as expected

Can anyone explain why the following snippet returns true? According to the docs for The "d" custom format specifier, "A …

c# datetime tryparse