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
- ProbeMatchesApril2005.cs
- HttpFileCollection.cs
- ValidationResult.cs
- ChangePassword.cs
- WeakEventTable.cs
- XhtmlCssHandler.cs
- Rotation3DAnimationBase.cs
- KnownTypesHelper.cs
- FacetValueContainer.cs
- CreateParams.cs
- WebControlsSection.cs
- SizeAnimationClockResource.cs
- IRCollection.cs
- SessionKeyExpiredException.cs
- ButtonColumn.cs
- TemporaryBitmapFile.cs
- DeviceContext.cs
- ClassDataContract.cs
- WindowsToolbar.cs
- ErrorFormatterPage.cs
- ExceptionUtil.cs
- Vertex.cs
- CodeMemberProperty.cs
- smtpconnection.cs
- PositiveTimeSpanValidatorAttribute.cs
- PersonalizationState.cs
- ValueExpressions.cs
- KeyPullup.cs
- QilDataSource.cs
- SpeechAudioFormatInfo.cs
- PnrpPermission.cs
- StringUtil.cs
- DBDataPermissionAttribute.cs
- ZipIOFileItemStream.cs
- EntityKey.cs
- ProfileParameter.cs
- SchemaTableColumn.cs
- DataGridViewCellFormattingEventArgs.cs
- DesignerCategoryAttribute.cs
- HttpHandlersSection.cs
- TrackingStringDictionary.cs
- HighContrastHelper.cs
- ImageFormatConverter.cs
- TextRangeEditTables.cs
- EdmProviderManifest.cs
- RestHandlerFactory.cs
- Point3DKeyFrameCollection.cs
- Memoizer.cs
- JoinTreeNode.cs
- NumericPagerField.cs
- Crypto.cs
- Mappings.cs
- SqlConnection.cs
- XmlSerializerOperationFormatter.cs
- DictationGrammar.cs
- SqlDataSourceSelectingEventArgs.cs
- CodeNamespaceImport.cs
- FormsAuthentication.cs
- DotExpr.cs
- ApplicationServiceManager.cs
- GeneralTransformGroup.cs
- DataContractSerializerMessageContractImporter.cs
- UndoManager.cs
- XmlSerializerNamespaces.cs
- EntityChangedParams.cs
- TransformerInfo.cs
- MemoryFailPoint.cs
- IWorkflowDebuggerService.cs
- MarkupExtensionReturnTypeAttribute.cs
- connectionpool.cs
- MethodCallConverter.cs
- HtmlAnchor.cs
- CaseCqlBlock.cs
- FragmentQuery.cs
- TemplateField.cs
- PolicyLevel.cs
- StreamGeometry.cs
- MatchingStyle.cs
- SplineKeyFrames.cs
- ProfileInfo.cs
- XmlBindingWorker.cs
- DataGridViewSelectedColumnCollection.cs
- Transform.cs
- LineBreak.cs
- OAVariantLib.cs
- WindowsRichEditRange.cs
- ParameterToken.cs
- InvalidOleVariantTypeException.cs
- StateBag.cs
- Span.cs
- StorageMappingFragment.cs
- ResourceProviderFactory.cs
- CellTreeNode.cs
- ConvertTextFrag.cs
- InputLanguageProfileNotifySink.cs
- EntityException.cs
- ColumnResizeAdorner.cs
- MethodBuilderInstantiation.cs
- GACMembershipCondition.cs
- DesignerTextWriter.cs