checking for number

Discussion in 'Microsoft C# .NET' started by Servé La, Jan 21, 2005.

  1. Servé La

    Servé La Guest

    Is there a standard method to test if a string has a double value in it
    without using an exception?

    The only method I find is using Double.Parse(str), but this throws an
    exception which is essentially just another goto in your code preventing
    structured programming :)
     
    Servé La, Jan 21, 2005
    #1
    1. Advertisements

  2. Hi,


    Try Double.TryParse


    Cheers,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation



    "Servé La" <> wrote in message
    news:41f10271$0$6213$4all.nl...
    > Is there a standard method to test if a string has a double value in it
    > without using an exception?
    >
    > The only method I find is using Double.Parse(str), but this throws an
    > exception which is essentially just another goto in your code preventing
    > structured programming :)
    >
    >
     
    Ignacio Machin \( .NET/ C# MVP \), Jan 21, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josh Harris

    formatting number as a number in c#

    Josh Harris, Feb 26, 2004, in forum: Microsoft C# .NET
    Replies:
    0
    Views:
    152
    Josh Harris
    Feb 26, 2004
  2. zlf
    Replies:
    7
    Views:
    406
  3. zlf
    Replies:
    2
    Views:
    434
  4. Guest
    Replies:
    0
    Views:
    258
    Guest
    Oct 20, 2005
  5. Ryan Liu

    Chinese number is not a number, why 2 versions

    Ryan Liu, Mar 26, 2006, in forum: Microsoft C# .NET
    Replies:
    0
    Views:
    167
    Ryan Liu
    Mar 26, 2006
Loading...

Share This Page