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
- ChangeBlockUndoRecord.cs
- Selector.cs
- ParentControlDesigner.cs
- OrderedHashRepartitionStream.cs
- ColorKeyFrameCollection.cs
- FaultDescriptionCollection.cs
- AppPool.cs
- MaskDescriptors.cs
- XmlDataSourceView.cs
- StickyNote.cs
- SafeCertificateStore.cs
- XmlUrlResolver.cs
- FormCollection.cs
- WebProxyScriptElement.cs
- MessageRpc.cs
- UntrustedRecipientException.cs
- Clause.cs
- SourceFileBuildProvider.cs
- RuleSettingsCollection.cs
- BooleanToVisibilityConverter.cs
- DataServicePagingProviderWrapper.cs
- PipelineComponent.cs
- XPathScanner.cs
- SqlProfileProvider.cs
- PolicyDesigner.cs
- Win32Exception.cs
- IdentityHolder.cs
- DesignerVerb.cs
- TextEditorThreadLocalStore.cs
- RightsManagementEncryptionTransform.cs
- serverconfig.cs
- EnumMember.cs
- InvalidOperationException.cs
- SafeWaitHandle.cs
- DataContext.cs
- ServiceBehaviorAttribute.cs
- DataViewManagerListItemTypeDescriptor.cs
- EntryWrittenEventArgs.cs
- CodeDomComponentSerializationService.cs
- SmtpException.cs
- ExclusiveCanonicalizationTransform.cs
- FragmentQueryProcessor.cs
- TypeInformation.cs
- ServerIdentity.cs
- UpdatePanelTriggerCollection.cs
- QuerySelectOp.cs
- ArgumentValidation.cs
- ProgressBarBrushConverter.cs
- InstanceLockedException.cs
- Matrix3DStack.cs
- ValidationResult.cs
- NullExtension.cs
- TiffBitmapEncoder.cs
- HttpServerUtilityWrapper.cs
- Brush.cs
- XPathNavigatorReader.cs
- TypeUsageBuilder.cs
- DbProviderServices.cs
- ThreadPool.cs
- PackageStore.cs
- ApplicationInfo.cs
- TreeNodeBinding.cs
- DataSourceHelper.cs
- KoreanCalendar.cs
- ThemeableAttribute.cs
- Currency.cs
- ListViewGroup.cs
- HashHelper.cs
- HttpRawResponse.cs
- CreateUserWizardStep.cs
- DataTableCollection.cs
- Material.cs
- TreeViewItemAutomationPeer.cs
- FontStyle.cs
- SettingsPropertyCollection.cs
- ExtensionDataObject.cs
- TerminatingOperationBehavior.cs
- HttpRequestCacheValidator.cs
- IsolationInterop.cs
- ServiceDurableInstanceContextProvider.cs
- HttpHeaderCollection.cs
- Attributes.cs
- MatrixTransform.cs
- MultiTrigger.cs
- ISAPIWorkerRequest.cs
- SizeFConverter.cs
- ContentTextAutomationPeer.cs
- RoutedEventArgs.cs
- SafeFileHandle.cs
- GuidelineCollection.cs
- SiteOfOriginContainer.cs
- MenuItemStyle.cs
- HtmlTableCellCollection.cs
- XmlDomTextWriter.cs
- StorageInfo.cs
- UnhandledExceptionEventArgs.cs
- AttributeQuery.cs
- ErrorFormatterPage.cs
- UserPreferenceChangingEventArgs.cs
- rsa.cs