By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 941 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Comparing two values - vs2005

P: n/a
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
Nov 21 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
Nov 21 '08 #2

P: n/a
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
Nov 21 '08 #3

P: n/a
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

Nov 21 '08 #4

P: n/a
On Fri, 21 Nov 2008 07:55:01 -0800, Rick <Ri**@discussions.microsoft.com>
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.

Nov 21 '08 #5

P: n/a
On Nov 21, 1:27 pm, Rick <R...@discussions.microsoft.comwrote:
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");
Nov 21 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.