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
- DoubleCollectionValueSerializer.cs
- OdbcConnectionHandle.cs
- IisTraceWebEventProvider.cs
- FormViewRow.cs
- TrustManagerPromptUI.cs
- ListViewDataItem.cs
- OdbcHandle.cs
- UIElementPropertyUndoUnit.cs
- SmtpMail.cs
- ByeOperationAsyncResult.cs
- XPathParser.cs
- AutoGeneratedField.cs
- ResumeStoryboard.cs
- GlyphElement.cs
- DateTimeUtil.cs
- SoapInteropTypes.cs
- ValidationSummary.cs
- infer.cs
- Authorization.cs
- FolderBrowserDialogDesigner.cs
- AttachInfo.cs
- HandleCollector.cs
- ToolStripDropDownClosedEventArgs.cs
- TransformValueSerializer.cs
- SHA512Managed.cs
- EntityDataSourceSelectingEventArgs.cs
- AssemblyNameUtility.cs
- WindowsListViewSubItem.cs
- AssemblyUtil.cs
- ToolboxItemAttribute.cs
- SqlFunctionAttribute.cs
- ReadOnlyCollection.cs
- PointLight.cs
- odbcmetadatacolumnnames.cs
- AnnouncementSendsAsyncResult.cs
- ItemsPresenter.cs
- CqlErrorHelper.cs
- TextReader.cs
- RtfNavigator.cs
- Bidi.cs
- TypeElement.cs
- LongTypeConverter.cs
- BindStream.cs
- FontStyle.cs
- ModelItemDictionaryImpl.cs
- ReadOnlyDataSourceView.cs
- GeometryCombineModeValidation.cs
- SqlBuilder.cs
- TaiwanLunisolarCalendar.cs
- FixedSOMTableRow.cs
- WebPartDisplayModeEventArgs.cs
- Vector3DAnimationUsingKeyFrames.cs
- AuthenticationServiceManager.cs
- GroupBoxRenderer.cs
- PriorityQueue.cs
- SoapObjectInfo.cs
- OleDbEnumerator.cs
- Filter.cs
- Comparer.cs
- HttpWebRequestElement.cs
- MessageBuffer.cs
- ApplicationFileParser.cs
- PropertyIdentifier.cs
- DecimalAnimationUsingKeyFrames.cs
- commandenforcer.cs
- StateDesigner.LayoutSelectionGlyph.cs
- ConstantSlot.cs
- Misc.cs
- XmlNodeChangedEventArgs.cs
- InternalConfigEventArgs.cs
- LookupBindingPropertiesAttribute.cs
- BinHexDecoder.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- XsltArgumentList.cs
- EntityClassGenerator.cs
- ConstantSlot.cs
- WebZoneDesigner.cs
- TracedNativeMethods.cs
- Event.cs
- Serializer.cs
- NumericExpr.cs
- ListItemParagraph.cs
- PenThreadPool.cs
- OutputWindow.cs
- FilterElement.cs
- ArgumentNullException.cs
- PolyQuadraticBezierSegment.cs
- Stack.cs
- SqlConnectionFactory.cs
- SqlNode.cs
- MailAddressCollection.cs
- XhtmlConformanceSection.cs
- StructuralType.cs
- RightsManagementPermission.cs
- CalendarDay.cs
- ByteStreamGeometryContext.cs
- TypeInitializationException.cs
- SelectedCellsCollection.cs
- InvalidComObjectException.cs
- IisTraceWebEventProvider.cs