![]()
A new object whose values are a copy of the current Version object.
If the type of the return value is important, cast the object instance that is returned by this method to a Version object.
The following example clones the version number and writes the result to the console.
C# Example
using System;
class VersionCloneExample {
public static void Main() {
Version vers = new Version("6.1.2.4");
Console.WriteLine("The string representation of the" +
" version is {0}.",
vers.ToString());
Version clone = (Version) vers.Clone();
Console.WriteLine("The original version was" +
" successfully cloned.");
Console.Write("The string representation of the" +
" cloned version is {0}.",
clone.ToString());
}
}
The output is
The string representation of the version is 6.1.2.4.