﻿<?xml version="1.0" encoding="utf-8"?><Type Name="CharEnumerator" FullName="System.CharEnumerator" FullNameSP="System_CharEnumerator" Maintainer="ecma"><TypeSignature Language="ILASM" Value=".class public sealed serializable CharEnumerator extends System.Object implements System.ICloneable, System.Collections.IEnumerator" /><TypeSignature Language="C#" Value="public sealed class CharEnumerator : ICloneable, System.Collections.Generic.IEnumerator&lt;char&gt;" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit CharEnumerator extends System.Object implements class System.Collections.Generic.IEnumerator`1&lt;char&gt;, class System.Collections.IEnumerator, class System.ICloneable, class System.IDisposable" /><MemberOfLibrary>BCL</MemberOfLibrary><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement><Base><BaseTypeName>System.Object</BaseTypeName></Base><Interfaces><Interface><InterfaceName>System.Collections.Generic.IEnumerator&lt;System.Char&gt;</InterfaceName></Interface><Interface><InterfaceName>System.ICloneable</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>A <see cref="T:System.CharEnumerator" /> provides read-only access to the characters in a referenced <see cref="T:System.String" /> object. For example, the foreach statement of the Microsoft Visual Basic and C# programming languages, which iterates through the elements of a collection, retrieves a <see cref="T:System.CharEnumerator" /> from a <see cref="T:System.String" /> object in order to iterate through the characters in that object.</para><para>There is no public constructor for <see cref="T:System.CharEnumerator" />. Instead, call a <see cref="T:System.String" /> object's <see cref="M:System.String.GetEnumerator" /> method to obtain a <see cref="T:System.CharEnumerator" /> that is initialized to reference the string.</para><para>A <see cref="T:System.CharEnumerator" /> maintains an internal index to the characters in the string the <see cref="T:System.CharEnumerator" /> references. The state of the index is invalid when it references a character position logically before the first character or after the last character in the string, and valid when it references a character within the string. The index is initialized to a position logically before the first character, and is set to a position after the last character when the iteration is complete. An exception is thrown if you attempt to access a character while the index is invalid.</para><para>The <see cref="M:System.CharEnumerator.MoveNext" /> method increments the index by one, so the first and subsequent characters are accessed in turn. The <see cref="M:System.CharEnumerator.Reset" /> method sets the index to a position logically before the first character. The <see cref="P:System.CharEnumerator.Current" /> property retrieves the character currently referenced by index. The <see cref="M:System.CharEnumerator.Clone" /> method creates a copy of the <see cref="T:System.CharEnumerator" />.</para><block subset="none" type="note"><para>Several independent instances of <see cref="T:System.CharEnumerator" /> across one or more threads can have access to a single instance of <see cref="T:System.String" />. This class is implemented to support the <see cref="T:System.Collections.IEnumerator" /> interface. For more information regarding the use of an enumerator, see the <see cref="T:System.Collections.IEnumerator" /> topic.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Supports iterating over a <see cref="T:System.String" /> object and reading its individual characters. This class cannot be inherited.</para></summary></Docs><Members><Member MemberName="Clone"><MemberSignature Language="ILASM" Value=".method public final hidebysig virtual object Clone()" /><MemberSignature Language="C#" Value="public object Clone ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object Clone() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Object</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The return value is a copy of this instance of <see cref="T:System.CharEnumerator" /> and its current state. This is useful for saving your state while iterating through a <see cref="T:System.String" /> object.</para><para>For example, suppose your application uses an original instance of <see cref="T:System.CharEnumerator" /> to iterate through each character in a <see cref="T:System.String" />. When some unique character is encountered, your application pauses processing and invokes the <see cref="M:System.CharEnumerator.Clone" /> method. In effect, this saves the <see cref="T:System.CharEnumerator" /> object's index in the <see cref="T:System.String" />.</para><para>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 <see cref="T:System.CharEnumerator" /> instance to resume working on the <see cref="T:System.String" /> where the original processing stopped.</para><block subset="none" type="note"><para>This method is implemented to support the <see cref="T:System.ICloneable" /> interface.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Creates a copy of the current <see cref="T:System.CharEnumerator" /> object.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>An <see cref="T:System.Object" /> that is a copy of the current <see cref="T:System.CharEnumerator" /> object.</para></returns></Docs><Excluded>0</Excluded></Member><Member MemberName="Current"><MemberSignature Language="ILASM" Value=".property valuetype System.Char Current { public hidebysig specialname instance valuetype System.Char get_Current() }" /><MemberSignature Language="C#" Value="public char Current { get; }" /><MemberSignature Language="ILAsm" Value=".property instance char Current" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Char</ReturnType></ReturnValue><Parameters /><Docs><value><para>The <see cref="T:System.Char" /> in the <see cref="T:System.String" /> over which the current instance is
   positioned.</para></value><exception cref="T:System.InvalidOperationException"><para>The current instance is positioned before the first element or after the last element of the <see cref="T:System.String" />.</para></exception><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The <see cref="T:System.CharEnumerator" /> class maintains an internal index to the enumerated string, and the <see cref="P:System.CharEnumerator.Current" /> property returns the character that is currently referenced by the index. This property should be invoked only when the index is valid; otherwise, an exception is thrown. </para><para>The index is always invalid for an empty string (""). The index is also invalid after the <see cref="M:System.String.GetEnumerator" /> or <see cref="M:System.CharEnumerator.Reset" /> method is called. After either of these methods is called, invoke the <see cref="M:System.CharEnumerator.MoveNext" /> method to adjust the index to the first character in the enumerated string. The index is valid whenever the <see cref="M:System.CharEnumerator.MoveNext" /> method returns true.</para><para><see cref="P:System.CharEnumerator.Current" /> does not move the index, and consecutive calls to <see cref="P:System.CharEnumerator.Current" /> return the same character until <see cref="M:System.CharEnumerator.MoveNext" />, <see cref="M:System.CharEnumerator.Reset" />, or <see cref="M:System.String.GetEnumerator" /> is called.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the currently referenced character in the string enumerated by this <see cref="T:System.CharEnumerator" /> object.</para></summary></Docs><Excluded>0</Excluded></Member><Member MemberName="Dispose"><MemberSignature Language="C#" Value="public void Dispose ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Call <see cref="M:System.CharEnumerator.Dispose" /> when you are finished using the <see cref="T:System.CharEnumerator" />. The <see cref="M:System.CharEnumerator.Dispose" /> method leaves the <see cref="T:System.CharEnumerator" /> in an unusable state. After calling <see cref="M:System.CharEnumerator.Dispose" />, you must release all references to the <see cref="T:System.CharEnumerator" /> so the garbage collector can reclaim the memory that the <see cref="T:System.CharEnumerator" /> was occupying.</para><para>For more information, see <format type="text/html"><a href="A17B0066-71C2-4BA4-9822-8E19332FC213">Cleaning Up Unmanaged Resources</a></format> and <format type="text/html"><a href="eb4e1af0-3b48-4fbc-ad4e-fc2f64138bf9">Implementing a Dispose Method</a></format>.</para><block subset="none" type="note"><para>Always call <see cref="M:System.CharEnumerator.Dispose" /> before you release your last reference to the <see cref="T:System.CharEnumerator" />. Otherwise, the resources it is using will not be freed until the garbage collector calls the <see cref="T:System.CharEnumerator" /> object's Finalize method.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Releases all resources used by the current instance of the <see cref="T:System.CharEnumerator" /> class.</para></summary></Docs></Member><Member MemberName="MoveNext"><MemberSignature Language="ILASM" Value=".method public final hidebysig virtual bool MoveNext()" /><MemberSignature Language="C#" Value="public bool MoveNext ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool MoveNext() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The <see cref="T:System.CharEnumerator" /> class maintains an internal index to the enumerated string, and the <see cref="M:System.CharEnumerator.MoveNext" /> method increments the index by one. Call <see cref="M:System.CharEnumerator.MoveNext" /> after calling <see cref="M:System.String.GetEnumerator" /> or <see cref="M:System.CharEnumerator.Reset" /> to increment the current character position to the first character in the enumerated string. Check that the return value is true to determine that the current character position is valid.</para><para>If the index is already beyond the last character of the enumerated string, the index is not changed and false is returned.</para><para>Notice that if the enumerated string is empty (""), the state of the <see cref="T:System.CharEnumerator" /> is always invalid. This is because the internal index for the <see cref="T:System.CharEnumerator" /> is initially before the first character of the enumerated string and is therefore invalid. <see cref="M:System.CharEnumerator.MoveNext" /> logically sets the index after the last (nonexistent) character of the enumerated string which is also invalid.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Increments the internal index of the current <see cref="T:System.CharEnumerator" /> object to the next character of the enumerated string.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>true if the index is successfully incremented and within the enumerated string; otherwise, false.</para></returns></Docs><Excluded>0</Excluded></Member><Member MemberName="Reset"><MemberSignature Language="ILASM" Value=".method public final hidebysig virtual void Reset()" /><MemberSignature Language="C#" Value="public void Reset ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Reset() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The <see cref="T:System.CharEnumerator" /> class maintains an internal index to the enumerated string, and the <see cref="M:System.CharEnumerator.Reset" /> method sets the index to the invalid state.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes the index to a position logically before the first character of the enumerated string.</para></summary></Docs><Excluded>0</Excluded></Member><Member MemberName="System.Collections.IEnumerator.Current"><MemberSignature Language="C#" Value="object System.Collections.IEnumerator.Current { get; }" /><MemberSignature Language="ILAsm" Value=".property instance object System.Collections.IEnumerator.Current" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Object</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This member is an explicit interface member implementation. It can be used only when the <see cref="T:System.CharEnumerator" /> instance is cast to an <see cref="T:System.Collections.IEnumerator" /> interface.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the currently referenced character in the string enumerated by this <see cref="T:System.CharEnumerator" /> object. For a description of this member, see <see cref="P:System.Collections.IEnumerator.Current" />. </para></summary></Docs></Member><Member MemberName="System.IDisposable.Dispose"><MemberSignature Language="C#" Value="void IDisposable.Dispose ();" /><MemberType>Method</MemberType><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><since version=".NET 2.0" /><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Call <see cref="M:System.CharEnumerator.System#IDisposable#Dispose" /> when you are finished using the <see cref="T:System.CharEnumerator" /> class. The method leaves the <see cref="T:System.CharEnumerator" /> class in an unusable state. After calling it, you must release all references to the <see cref="T:System.CharEnumerator" /> class so the garbage collector can reclaim the memory that the <see cref="T:System.CharEnumerator" /> class was occupying.</para><para>For more information, see <format type="text/html"><a href="a17b0066-71c2-4ba4-9822-8e19332fc213">Cleaning Up Unmanaged Resources</a></format> and <format type="text/html"><a href="eb4e1af0-3b48-4fbc-ad4e-fc2f64138bf9">Implementing a Dispose Method</a></format>.</para><block subset="none" type="note"><para>Always call <see cref="M:System.CharEnumerator.System#IDisposable#Dispose" /> before you release your last reference to the <see cref="T:System.CharEnumerator" /> class. Otherwise, the resources it is using will not be freed until the garbage collector calls the <see cref="T:System.CharEnumerator" /> object's <see cref="M:System.Object.Finalize" /> method.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Releases all resources used by the <see cref="T:System.CharEnumerator" /> class.</para></summary></Docs><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion></AssemblyInfo></Member></Members><TypeExcluded>0</TypeExcluded></Type>