Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / CharEnumerator.cs / 1 / CharEnumerator.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: CharEnumerator ** ** ** Purpose: Enumerates the characters on a string. skips range ** checks. ** ** ============================================================*/ namespace System { using System.Collections; using System.Collections.Generic; [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public sealed class CharEnumerator : IEnumerator, ICloneable, IEnumerator{ private String str; private int index; private char currentElement; internal CharEnumerator(String str) { this.str = str; this.index = -1; } public Object Clone() { return MemberwiseClone(); } public bool MoveNext() { if (index < (str.Length-1)) { index++; currentElement = str[index]; return true; } else index = str.Length; return false; } void IDisposable.Dispose() { } /// Object IEnumerator.Current { get { if (index == -1) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); if (index >= str.Length) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); return currentElement; } } public char Current { get { if (index == -1) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); if (index >= str.Length) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); return currentElement; } } public void Reset() { currentElement = (char)0; index = -1; } } }
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RtfToken.cs
- SqlDataSourceStatusEventArgs.cs
- FixedPageStructure.cs
- DataGridViewRowPrePaintEventArgs.cs
- HtmlInputSubmit.cs
- RoleService.cs
- SchemaDeclBase.cs
- PeerApplicationLaunchInfo.cs
- DataControlLinkButton.cs
- ResetableIterator.cs
- UnhandledExceptionEventArgs.cs
- ReverseComparer.cs
- TextTreeDeleteContentUndoUnit.cs
- LoginCancelEventArgs.cs
- COM2Properties.cs
- OverflowException.cs
- _FixedSizeReader.cs
- TreeNodeStyleCollection.cs
- Atom10FormatterFactory.cs
- BamlLocalizationDictionary.cs
- InstanceLockTracking.cs
- ExpressionSelection.cs
- ApplyTemplatesAction.cs
- JsonFormatGeneratorStatics.cs
- Mapping.cs
- basecomparevalidator.cs
- CommandValueSerializer.cs
- TypeConstant.cs
- ToolBarButton.cs
- UrlAuthorizationModule.cs
- DesignerAdapterAttribute.cs
- TaskFormBase.cs
- SuppressIldasmAttribute.cs
- ClientBuildManagerCallback.cs
- AutomationPropertyInfo.cs
- DeflateEmulationStream.cs
- MsmqIntegrationProcessProtocolHandler.cs
- HostingPreferredMapPath.cs
- XmlQualifiedNameTest.cs
- ExpressionPrinter.cs
- RayMeshGeometry3DHitTestResult.cs
- FacetEnabledSchemaElement.cs
- BufferModeSettings.cs
- ParameterRetriever.cs
- TcpTransportElement.cs
- JsonXmlDataContract.cs
- ResolvePPIDRequest.cs
- OverrideMode.cs
- CollectionConverter.cs
- X509ChainElement.cs
- ObjectStateFormatter.cs
- ProgressBar.cs
- NullRuntimeConfig.cs
- SwitchAttribute.cs
- Collection.cs
- ProxyWebPartConnectionCollection.cs
- XmlTextReader.cs
- IntSecurity.cs
- XmlDeclaration.cs
- QEncodedStream.cs
- CodeRemoveEventStatement.cs
- BaseComponentEditor.cs
- CellParaClient.cs
- AtlasWeb.Designer.cs
- HttpDigestClientCredential.cs
- SslStream.cs
- Image.cs
- DateTimeConstantAttribute.cs
- PluralizationService.cs
- FilterElement.cs
- ZipIOModeEnforcingStream.cs
- XmlEntity.cs
- EventProxy.cs
- StylusPointPropertyInfo.cs
- Msmq4PoisonHandler.cs
- ExceptionUtil.cs
- ImageBrush.cs
- ZipIOBlockManager.cs
- MessageFilter.cs
- BinaryFormatterWriter.cs
- FormsAuthenticationConfiguration.cs
- SocketInformation.cs
- RenderTargetBitmap.cs
- DrawingGroupDrawingContext.cs
- UnauthorizedWebPart.cs
- MediaScriptCommandRoutedEventArgs.cs
- WebPartConnectionsConfigureVerb.cs
- ScrollBar.cs
- Image.cs
- ValidateNames.cs
- ListBoxItemAutomationPeer.cs
- TextProviderWrapper.cs
- DataTrigger.cs
- MethodBody.cs
- PageBuildProvider.cs
- RootCodeDomSerializer.cs
- AttachmentCollection.cs
- Size3DValueSerializer.cs
- GACIdentityPermission.cs
- RadialGradientBrush.cs