CharEnumerator.Clone Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a copy of the current CharEnumerator object.
public:
virtual System::Object ^ Clone();
public object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Function Clone () As Object
Returns
An Object that is a copy of the current CharEnumerator object.
Implements
Remarks
The return value is a copy of this instance of CharEnumerator and its current state. This is useful for saving your state while iterating through a String object.
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.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기