Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / StringUtil.cs / 1305376 / StringUtil.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Security; using System.Text; using System.Xml; using Microsoft.Win32; static internal class StringUtil { #if UNUSED_CODE /* * Determines if two strings are equal. */ internal static bool Equals(string s1, string s2) { return String.Equals(s1, s2, StringComparison.Ordinal); } #endif /* * Determines if two strings are equal. Treats null and String.Empty as equivalent. */ internal static bool EqualsNE(string s1, string s2) { if (s1 == null) { s1 = String.Empty; } if (s2 == null) { s2 = String.Empty; } return String.Equals(s1, s2, StringComparison.Ordinal); } /* * Determines if two strings are equal, ignoring case. */ internal static bool EqualsIgnoreCase(string s1, string s2) { return String.Equals(s1, s2, StringComparison.OrdinalIgnoreCase); } #if UNUSED_CODE /* * Determines if two strings are equal, ignoring case. Treats null and String.Empty as equivalent. */ internal static bool EqualsIgnoreCaseNE(string s1, string s2) { if (s1 == null) { s1 = String.Empty; } if (s2 == null) { s2 = String.Empty; } return String.Equals(s1, s2, StringComparison.OrdinalIgnoreCase); } #endif /* * Determines if the first string starts with the second string, ignoring case. */ internal static bool StartsWith(string s1, string s2) { if (s2 == null) { return false; } return 0 == String.Compare(s1, 0, s2, 0, s2.Length, StringComparison.Ordinal); } /* * Determines if the first string starts with the second string, ignoring case. */ internal static bool StartsWithIgnoreCase(string s1, string s2) { if (s2 == null) { return false; } return 0 == String.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase); } internal static string[] ObjectArrayToStringArray(object[] objectArray) { String[] stringKeys = new String[objectArray.Length]; objectArray.CopyTo(stringKeys, 0); return stringKeys; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Security; using System.Text; using System.Xml; using Microsoft.Win32; static internal class StringUtil { #if UNUSED_CODE /* * Determines if two strings are equal. */ internal static bool Equals(string s1, string s2) { return String.Equals(s1, s2, StringComparison.Ordinal); } #endif /* * Determines if two strings are equal. Treats null and String.Empty as equivalent. */ internal static bool EqualsNE(string s1, string s2) { if (s1 == null) { s1 = String.Empty; } if (s2 == null) { s2 = String.Empty; } return String.Equals(s1, s2, StringComparison.Ordinal); } /* * Determines if two strings are equal, ignoring case. */ internal static bool EqualsIgnoreCase(string s1, string s2) { return String.Equals(s1, s2, StringComparison.OrdinalIgnoreCase); } #if UNUSED_CODE /* * Determines if two strings are equal, ignoring case. Treats null and String.Empty as equivalent. */ internal static bool EqualsIgnoreCaseNE(string s1, string s2) { if (s1 == null) { s1 = String.Empty; } if (s2 == null) { s2 = String.Empty; } return String.Equals(s1, s2, StringComparison.OrdinalIgnoreCase); } #endif /* * Determines if the first string starts with the second string, ignoring case. */ internal static bool StartsWith(string s1, string s2) { if (s2 == null) { return false; } return 0 == String.Compare(s1, 0, s2, 0, s2.Length, StringComparison.Ordinal); } /* * Determines if the first string starts with the second string, ignoring case. */ internal static bool StartsWithIgnoreCase(string s1, string s2) { if (s2 == null) { return false; } return 0 == String.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase); } internal static string[] ObjectArrayToStringArray(object[] objectArray) { String[] stringKeys = new String[objectArray.Length]; objectArray.CopyTo(stringKeys, 0); return stringKeys; } } } // 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
- TreeIterator.cs
- SoapSchemaMember.cs
- CommunicationObjectManager.cs
- Brush.cs
- PropertyDescriptors.cs
- XamlStream.cs
- ProviderConnectionPoint.cs
- formatstringdialog.cs
- LogSwitch.cs
- HttpFormatExtensions.cs
- SafeReadContext.cs
- MessageDecoder.cs
- ProfilePropertySettingsCollection.cs
- Table.cs
- DescriptionAttribute.cs
- ConfigXmlElement.cs
- SimpleWorkerRequest.cs
- Closure.cs
- PropVariant.cs
- CodeExporter.cs
- SafeLibraryHandle.cs
- MarkupCompiler.cs
- DataGridViewAccessibleObject.cs
- ReadOnlyDataSourceView.cs
- MemberInfoSerializationHolder.cs
- ConfigurationCollectionAttribute.cs
- ITextView.cs
- CSharpCodeProvider.cs
- PrintingPermission.cs
- IpcServerChannel.cs
- MyContact.cs
- Button.cs
- SqlUserDefinedAggregateAttribute.cs
- TemplateField.cs
- HttpWriter.cs
- CssTextWriter.cs
- DataErrorValidationRule.cs
- ItemsChangedEventArgs.cs
- SocketManager.cs
- SecurityPolicyVersion.cs
- CultureInfoConverter.cs
- MetadataItem.cs
- HwndHost.cs
- WebBrowserNavigatingEventHandler.cs
- EncoderExceptionFallback.cs
- OracleBinary.cs
- SafeUserTokenHandle.cs
- DesignerVerb.cs
- Grid.cs
- BooleanToVisibilityConverter.cs
- SizeFConverter.cs
- KeyedCollection.cs
- EUCJPEncoding.cs
- TransportSecurityBindingElement.cs
- SQLDateTimeStorage.cs
- EnvironmentPermission.cs
- PeerApplication.cs
- HistoryEventArgs.cs
- WebServiceEnumData.cs
- _HeaderInfo.cs
- SamlAssertion.cs
- WorkflowControlClient.cs
- ComboBoxHelper.cs
- BulletedListEventArgs.cs
- StronglyTypedResourceBuilder.cs
- TypeConverterAttribute.cs
- ReflectionUtil.cs
- InfiniteIntConverter.cs
- ObjectStateManagerMetadata.cs
- TextEditorSelection.cs
- TargetParameterCountException.cs
- XmlSerializationGeneratedCode.cs
- DnsCache.cs
- EdmComplexPropertyAttribute.cs
- ColorAnimation.cs
- TabPanel.cs
- WebBaseEventKeyComparer.cs
- IgnoreSectionHandler.cs
- HandleCollector.cs
- BamlCollectionHolder.cs
- AutomationElement.cs
- RadioButtonRenderer.cs
- ControlType.cs
- Keyboard.cs
- FlowDocumentView.cs
- RichTextBox.cs
- SignerInfo.cs
- CodeTryCatchFinallyStatement.cs
- ModelItem.cs
- TemplateXamlParser.cs
- KeyedHashAlgorithm.cs
- EventHandlersDesigner.cs
- Vector3DAnimationBase.cs
- PopOutPanel.cs
- XmlSerializerFaultFormatter.cs
- ColumnResizeUndoUnit.cs
- EntitySet.cs
- safelink.cs
- MemoryPressure.cs
- RuntimeWrappedException.cs