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
- MatrixTransform3D.cs
- HtmlTernaryTree.cs
- ACL.cs
- ProvidersHelper.cs
- TaskFormBase.cs
- ErrorWrapper.cs
- DBAsyncResult.cs
- XmlWriter.cs
- BrowserCapabilitiesFactoryBase.cs
- WebPartEditorCancelVerb.cs
- Fx.cs
- RegexCaptureCollection.cs
- ITextView.cs
- HttpStreamMessage.cs
- OleAutBinder.cs
- CalendarDay.cs
- CorrelationToken.cs
- TreeNodeStyleCollection.cs
- AutomationPeer.cs
- RuleInfoComparer.cs
- UnsafeCollabNativeMethods.cs
- ApplicationSecurityInfo.cs
- DesignerAttributeInfo.cs
- NonParentingControl.cs
- StickyNoteAnnotations.cs
- MergeExecutor.cs
- StylusSystemGestureEventArgs.cs
- serverconfig.cs
- ToolboxControl.cs
- ScriptControl.cs
- QuaternionIndependentAnimationStorage.cs
- SelectionRange.cs
- XpsFilter.cs
- SqlDataSourceSelectingEventArgs.cs
- BitmapImage.cs
- HttpUnhandledOperationInvoker.cs
- HuffCodec.cs
- SoapConverter.cs
- HttpInputStream.cs
- ProxyAttribute.cs
- XmlArrayAttribute.cs
- HopperCache.cs
- MatrixConverter.cs
- DoubleAnimationUsingPath.cs
- SchemaCollectionCompiler.cs
- MethodImplAttribute.cs
- Base64Decoder.cs
- AssemblyInfo.cs
- PropertyIdentifier.cs
- TypedReference.cs
- Panel.cs
- InvokePattern.cs
- RegexInterpreter.cs
- XPathScanner.cs
- RectangleF.cs
- DataViewSettingCollection.cs
- Roles.cs
- EncodingNLS.cs
- MachineKeyValidationConverter.cs
- OperationInvokerBehavior.cs
- PingOptions.cs
- RawStylusInputReport.cs
- ACE.cs
- RowSpanVector.cs
- TextStore.cs
- StorageMappingItemLoader.cs
- PhonemeConverter.cs
- XmlAttributeProperties.cs
- PersonalizationProvider.cs
- IndexOutOfRangeException.cs
- Group.cs
- SpecularMaterial.cs
- UInt16Converter.cs
- ListViewDeleteEventArgs.cs
- EventHandlersStore.cs
- FileCodeGroup.cs
- SafeNativeMethods.cs
- WindowsStatusBar.cs
- PropertyToken.cs
- DataServiceStreamProviderWrapper.cs
- EmbossBitmapEffect.cs
- FilterEventArgs.cs
- UTF8Encoding.cs
- DataGridViewTextBoxColumn.cs
- TreeViewEvent.cs
- HandleCollector.cs
- LifetimeServices.cs
- StringInfo.cs
- SystemUnicastIPAddressInformation.cs
- CodeTypeReferenceExpression.cs
- ListItemParagraph.cs
- UInt64Storage.cs
- WebException.cs
- UriScheme.cs
- ClockController.cs
- EntityObject.cs
- CharAnimationBase.cs
- XAMLParseException.cs
- CodeCompileUnit.cs
- DocumentCollection.cs