Comparing two values - vs2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Umljaw==?=

    Comparing two values - vs2005

    I have a string value 5.2.1 and I need to know how to compare if this value
    is greater than or equlas to 5.1.4
  • Hans Kesting

    #2
    Re: Comparing two values - vs2005

    Rick pretended :
    I have a string value 5.2.1 and I need to know how to compare if this value
    is greater than or equlas to 5.1.4
    Load them in a Version class, then you can compare them.

    This works only if
    a) the parts are separated by a '.'
    b) the parts are integers (no "1.2a")
    c) there are not more than 4 parts (less is fine)

    Hans Kesting


    Comment

    • =?Utf-8?B?Umljaw==?=

      #3
      Re: Comparing two values - vs2005

      Couls you please provide me with more information?
      How do I load them in a version class?

      "Hans Kesting" wrote:
      Rick pretended :
      I have a string value 5.2.1 and I need to know how to compare if this value
      is greater than or equlas to 5.1.4
      >
      Load them in a Version class, then you can compare them.
      >
      This works only if
      a) the parts are separated by a '.'
      b) the parts are integers (no "1.2a")
      c) there are not more than 4 parts (less is fine)
      >
      Hans Kesting
      >
      >
      >

      Comment

      • =?Utf-8?B?Umljaw==?=

        #4
        Re: Comparing two values - vs2005

        Actually, I need it for VS2003 not VS2005.

        "Rick" wrote:
        Couls you please provide me with more information?
        How do I load them in a version class?
        >
        "Hans Kesting" wrote:
        >
        Rick pretended :
        I have a string value 5.2.1 and I need to know how to compare if this value
        is greater than or equlas to 5.1.4
        Load them in a Version class, then you can compare them.

        This works only if
        a) the parts are separated by a '.'
        b) the parts are integers (no "1.2a")
        c) there are not more than 4 parts (less is fine)

        Hans Kesting

        Comment

        • Peter Duniho

          #5
          Re: Comparing two values - vs2005

          On Fri, 21 Nov 2008 07:55:01 -0800, Rick <Rick@discussio ns.microsoft.co m>
          wrote:
          I have a string value 5.2.1 and I need to know how to compare if this
          value
          is greater than or equlas to 5.1.4
          If you could explain what about the String.Compare( ) method doesn't
          accomplish your goal, that would help us provide a better answer.

          Comment

          • Ignacio Machin ( .NET/ C# MVP )

            #6
            Re: Comparing two values - vs2005

            On Nov 21, 1:27 pm, Rick <R...@discussio ns.microsoft.co mwrote:
            Actually, I need it for VS2003 not VS2005.
            >
            "Rick" wrote:
            Couls you please provide me with more information?
            How do I load them in a version class?
            >
            "Hans Kesting" wrote:
            >
            Rick pretended :
            I have a string value 5.2.1 and I need to know how to compare if this value
            is greater than or equlas to 5.1.4
            >
            Load them in a Version class, then you can compare them.
            >
            This works only if
            a) the parts are separated by a '.'
            b) the parts are integers (no "1.2a")
            c) there are not more than 4 parts (less is fine)
            >
            Hans Kesting
            The version class is there since 1.0:

            Version v = new Version( "5.2.1");

            Comment

            Working...