Why use string manipulations to handle version numbers ?
I recommend using the System.Version class.
That class already manages all parts of a version (Build, Major, MajorRevision, Minor, MinorRevision, Revision).
You can easily compare version numbers, not only for a match, but also to check if a version number is older or newer than another :
Version v1 = new Version(2, 0);
Version v2 = new Version("2.1");
Console.Write("Version {0} is ", v1);
switch(v1.CompareTo(v2))
{
case 0:
Console.Write("the same as");
break;
case 1:
Console.Write("later than");
break;
case -1:
Console.Write("earlier than");
break;
}
Console.WriteLine(" Version {0}.", v2);
Take a look at this MSDN article about System.Version for more details and examples.
That class will save you the overhead of handling the different parts of a version number yourself using string manipulations.