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
- XamlVector3DCollectionSerializer.cs
- HtmlControl.cs
- ScrollBar.cs
- KnownColorTable.cs
- CqlIdentifiers.cs
- HttpWebResponse.cs
- UInt64.cs
- SectionXmlInfo.cs
- ProcessHost.cs
- InstalledFontCollection.cs
- RemotingServices.cs
- DataRecordInternal.cs
- UnsignedPublishLicense.cs
- Geometry3D.cs
- PolygonHotSpot.cs
- ConfigurationFileMap.cs
- WhereaboutsReader.cs
- DataGridViewBand.cs
- Cursors.cs
- X509ServiceCertificateAuthenticationElement.cs
- UpdateExpressionVisitor.cs
- login.cs
- GroupedContextMenuStrip.cs
- ToolBar.cs
- XXXOnTypeBuilderInstantiation.cs
- CounterCreationData.cs
- GenericParameterDataContract.cs
- FragmentNavigationEventArgs.cs
- TextFormatterImp.cs
- SplitContainer.cs
- TabControl.cs
- RowUpdatingEventArgs.cs
- ReliableMessagingHelpers.cs
- ParameterEditorUserControl.cs
- Delay.cs
- DbgCompiler.cs
- ClassImporter.cs
- ContainsRowNumberChecker.cs
- CombinedGeometry.cs
- RemoteWebConfigurationHost.cs
- SqlDataSourceSelectingEventArgs.cs
- SerializableTypeCodeDomSerializer.cs
- ProxyFragment.cs
- SingleBodyParameterMessageFormatter.cs
- VersionPair.cs
- Win32Native.cs
- LinqDataSourceSelectEventArgs.cs
- HeaderedItemsControl.cs
- SByte.cs
- PlainXmlSerializer.cs
- InputScopeAttribute.cs
- BaseResourcesBuildProvider.cs
- EncoderParameters.cs
- SolidColorBrush.cs
- EnterpriseServicesHelper.cs
- LinkedList.cs
- ErrorFormatter.cs
- webbrowsersite.cs
- assertwrapper.cs
- AttributedMetaModel.cs
- KeyValueInternalCollection.cs
- SemanticKeyElement.cs
- SchemaName.cs
- ReliableDuplexSessionChannel.cs
- M3DUtil.cs
- CompositeControl.cs
- CommonObjectSecurity.cs
- PropertyMap.cs
- FontSizeConverter.cs
- XmlChildNodes.cs
- NodeFunctions.cs
- EntityDataSourceState.cs
- ProgressChangedEventArgs.cs
- RoleManagerEventArgs.cs
- TemplatePartAttribute.cs
- StringValidator.cs
- ApplicationSecurityManager.cs
- ColumnHeaderCollectionEditor.cs
- MediaContextNotificationWindow.cs
- ProxySimple.cs
- IndexerHelper.cs
- CqlLexer.cs
- TabRenderer.cs
- DecoderBestFitFallback.cs
- WebServicesSection.cs
- ToolStripEditorManager.cs
- FileRecordSequenceCompletedAsyncResult.cs
- StylusPointProperties.cs
- Missing.cs
- Clock.cs
- UniqueEventHelper.cs
- SchemaSetCompiler.cs
- Logging.cs
- ValueType.cs
- DataBoundLiteralControl.cs
- RegisteredExpandoAttribute.cs
- SkipQueryOptionExpression.cs
- PtsHost.cs
- ThemeableAttribute.cs
- ClientTargetSection.cs