Creates a copy of this instance.
[Visual Basic] Public Overridable Function Clone() As Object Implements _ ICloneable.Clone [C#] public virtual object Clone(); [C++] public: virtual Object* Clone(); [JScript] public function Clone() : Object;
An Object that is a copy of this instance.
For example, suppose your application uses an original instance of CharEnumerator to iterate through each character in a String. When some unique character is encountered, your application pauses processing and invokes the Clone method. In effect, this saves the CharEnumerator object's index in the String.
Your application uses the clone to navigate to another part of the String to perform some auxiliary processing. The side-effect of this navigation is the clone loses track of the position where processing stopped. However, when the auxiliary processing is complete, your application discards the clone and uses the original CharEnumerator instance to resume working on the String where the original processing stopped.
Note This method is implemented to support the ICloneable interface.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard