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
- Run.cs
- DocumentViewerConstants.cs
- EntityContainerAssociationSet.cs
- IsolatedStorageSecurityState.cs
- ImmutableObjectAttribute.cs
- IsolatedStorageException.cs
- PolygonHotSpot.cs
- SqlTransaction.cs
- XmlDictionaryWriter.cs
- AdRotator.cs
- XmlSchemaSimpleContentExtension.cs
- XmlComment.cs
- TimeIntervalCollection.cs
- XmlSchemaSimpleContentExtension.cs
- HtmlTableRowCollection.cs
- TemplateBindingExtensionConverter.cs
- ByteConverter.cs
- ZipIOLocalFileHeader.cs
- AdCreatedEventArgs.cs
- BuildManagerHost.cs
- ViewBox.cs
- hebrewshape.cs
- CodeLinePragma.cs
- EastAsianLunisolarCalendar.cs
- TraceInternal.cs
- ConnectionPoint.cs
- XPathQilFactory.cs
- MetadataUtilsSmi.cs
- WpfWebRequestHelper.cs
- ProfileSettings.cs
- CodeIdentifiers.cs
- GridViewColumnCollection.cs
- EncoderParameters.cs
- DropSource.cs
- QueryStringParameter.cs
- Application.cs
- LineInfo.cs
- TextBox.cs
- SqlDataSourceView.cs
- ToolStripControlHost.cs
- _FtpControlStream.cs
- ClientScriptManagerWrapper.cs
- ResourceReader.cs
- ObjectViewEntityCollectionData.cs
- Rule.cs
- CustomPopupPlacement.cs
- DesignerTransactionCloseEvent.cs
- AsmxEndpointPickerExtension.cs
- Keyboard.cs
- Exception.cs
- DbConvert.cs
- FlowDocument.cs
- HtmlSelectionListAdapter.cs
- ClientUtils.cs
- DllNotFoundException.cs
- TrackingParticipant.cs
- RequestCachePolicy.cs
- DocumentPageView.cs
- XmlILTrace.cs
- TransactedBatchingBehavior.cs
- HttpRuntime.cs
- LinkLabelLinkClickedEvent.cs
- FormsAuthenticationUserCollection.cs
- AutoResetEvent.cs
- StreamHelper.cs
- PropertyChangeTracker.cs
- OptionUsage.cs
- StartUpEventArgs.cs
- LoadItemsEventArgs.cs
- MessageContractExporter.cs
- CollectionViewProxy.cs
- SelectionBorderGlyph.cs
- ScrollItemProviderWrapper.cs
- ShimAsPublicXamlType.cs
- UpdatePanelControlTrigger.cs
- TransformValueSerializer.cs
- DetailsViewRowCollection.cs
- XsdDateTime.cs
- ObjectFullSpanRewriter.cs
- UserPreferenceChangingEventArgs.cs
- TextRange.cs
- TextDecoration.cs
- EndOfStreamException.cs
- LinqDataSourceUpdateEventArgs.cs
- ObjectNotFoundException.cs
- ExtenderHelpers.cs
- BulletChrome.cs
- FileSystemEventArgs.cs
- HtmlInputCheckBox.cs
- DataDesignUtil.cs
- SmiMetaDataProperty.cs
- AuthenticationServiceManager.cs
- PolyLineSegmentFigureLogic.cs
- ToolStripItemClickedEventArgs.cs
- DataControlCommands.cs
- PersistChildrenAttribute.cs
- WebConfigurationFileMap.cs
- HtmlTableCellCollection.cs
- XmlSerializerSection.cs
- FormConverter.cs