Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / ManagedLibraries / Remoting / Channels / CORE / StringHelper.cs / 1305376 / StringHelper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //============================================================ // // File: StringHelper.cs // // Summary: Helper methods for strings. // //=========================================================== using System; using System.IO; using System.Runtime.Remoting; namespace System.Runtime.Remoting.Channels { internal static class StringHelper { internal static bool StartsWithDoubleUnderscore(String str) { if (str.Length < 2) return false; return (str[0] == '_') && (str[1] == '_'); } // StartsWithDoubleUnderscore internal static bool StartsWithAsciiIgnoreCasePrefixLower(String str, String asciiPrefix) { // The caller should know that the arguments aren't null. int prefixLen = asciiPrefix.Length; if (str.Length < prefixLen) return false; for (int i = 0; i < prefixLen; i++) { // The prefix is assumed to be in lowercase if (ToLowerAscii(str[i]) != asciiPrefix[i]) { return false; } } return true; } // StartsWithAsciiIgnoreCase private static char ToLowerAscii(char ch) { if ((ch >= 'A') && (ch <= 'Z')) { return (char)(ch + ('a' - 'A')); } return ch; } // ToLowerAscii } // StringHelper } // namespace System.Runtime.Remoting.Channels // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //============================================================ // // File: StringHelper.cs // // Summary: Helper methods for strings. // //=========================================================== using System; using System.IO; using System.Runtime.Remoting; namespace System.Runtime.Remoting.Channels { internal static class StringHelper { internal static bool StartsWithDoubleUnderscore(String str) { if (str.Length < 2) return false; return (str[0] == '_') && (str[1] == '_'); } // StartsWithDoubleUnderscore internal static bool StartsWithAsciiIgnoreCasePrefixLower(String str, String asciiPrefix) { // The caller should know that the arguments aren't null. int prefixLen = asciiPrefix.Length; if (str.Length < prefixLen) return false; for (int i = 0; i < prefixLen; i++) { // The prefix is assumed to be in lowercase if (ToLowerAscii(str[i]) != asciiPrefix[i]) { return false; } } return true; } // StartsWithAsciiIgnoreCase private static char ToLowerAscii(char ch) { if ((ch >= 'A') && (ch <= 'Z')) { return (char)(ch + ('a' - 'A')); } return ch; } // ToLowerAscii } // StringHelper } // namespace System.Runtime.Remoting.Channels // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DiagnosticTraceSource.cs
- QuaternionValueSerializer.cs
- XmlToDatasetMap.cs
- TaskFormBase.cs
- DeflateStreamAsyncResult.cs
- FlowNode.cs
- WebBrowserContainer.cs
- GcSettings.cs
- DetailsViewUpdateEventArgs.cs
- WorkflowPrinting.cs
- SoapFault.cs
- selecteditemcollection.cs
- InputScopeNameConverter.cs
- Group.cs
- OdbcDataReader.cs
- XPathDocumentIterator.cs
- DependencyPropertyHelper.cs
- ServicePoint.cs
- InputReport.cs
- ApplicationProxyInternal.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- SiteMapProvider.cs
- Focus.cs
- LiteralTextParser.cs
- WindowsPen.cs
- EncryptedXml.cs
- HttpStreamXmlDictionaryWriter.cs
- WindowsIdentity.cs
- GroupQuery.cs
- DSASignatureFormatter.cs
- CollectionBuilder.cs
- WindowsFont.cs
- DataList.cs
- DbFunctionCommandTree.cs
- BamlLocalizabilityResolver.cs
- NotificationContext.cs
- IconBitmapDecoder.cs
- WriteFileContext.cs
- XmlNamespaceDeclarationsAttribute.cs
- VectorConverter.cs
- PasswordRecovery.cs
- WebPartPersonalization.cs
- SchemaSetCompiler.cs
- SafeBitVector32.cs
- ResourceContainer.cs
- SaveWorkflowCommand.cs
- PersonalizationStateQuery.cs
- StagingAreaInputItem.cs
- EndpointReference.cs
- SR.cs
- LeaseManager.cs
- CanonicalFontFamilyReference.cs
- _SafeNetHandles.cs
- WorkflowInstanceProxy.cs
- CTreeGenerator.cs
- NotifyCollectionChangedEventArgs.cs
- CodeEventReferenceExpression.cs
- DataGridState.cs
- Source.cs
- DataChangedEventManager.cs
- ResXDataNode.cs
- ProcessInfo.cs
- HtmlTitle.cs
- CompositeFontInfo.cs
- ContentOperations.cs
- MouseGesture.cs
- ModelPropertyDescriptor.cs
- BamlStream.cs
- Model3D.cs
- InheritanceAttribute.cs
- TextTreeTextNode.cs
- ClientTarget.cs
- UInt64Converter.cs
- LinkTarget.cs
- CategoryAttribute.cs
- PriorityQueue.cs
- ItemCollection.cs
- PropertyPath.cs
- ResourcesChangeInfo.cs
- TextShapeableCharacters.cs
- FormViewUpdateEventArgs.cs
- GenericPrincipal.cs
- GifBitmapDecoder.cs
- OperationCanceledException.cs
- SyndicationContent.cs
- TextServicesLoader.cs
- panel.cs
- CodeDelegateCreateExpression.cs
- FileUpload.cs
- LiteralDesigner.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ellipse.cs
- DataGridCaption.cs
- PropertyManager.cs
- WsdlBuildProvider.cs
- DataGridView.cs
- CoTaskMemHandle.cs
- WhiteSpaceTrimStringConverter.cs
- RangeValuePatternIdentifiers.cs
- AccessDataSource.cs