Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Configuration / System / Configuration / StringUtil.cs / 1 / 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
- BinaryCommonClasses.cs
- ChoiceConverter.cs
- DiscreteKeyFrames.cs
- PackageProperties.cs
- SynchronizedDispatch.cs
- AutomationProperty.cs
- ProviderSettingsCollection.cs
- TextWriter.cs
- LockedAssemblyCache.cs
- PaintEvent.cs
- CommandPlan.cs
- XmlSerializationReader.cs
- KeyFrames.cs
- CheckBoxPopupAdapter.cs
- WindowsListViewScroll.cs
- DataTableTypeConverter.cs
- Deflater.cs
- BindingOperations.cs
- VBCodeProvider.cs
- BufferedGraphicsContext.cs
- CustomCategoryAttribute.cs
- ProtocolsConfigurationEntry.cs
- CacheSection.cs
- DataGridItem.cs
- RefType.cs
- ReachFixedPageSerializerAsync.cs
- PagedDataSource.cs
- UnionCodeGroup.cs
- PointUtil.cs
- MouseGesture.cs
- ManagementInstaller.cs
- SpecialNameAttribute.cs
- ToolStripDropDownClosedEventArgs.cs
- ButtonFlatAdapter.cs
- DictionaryContent.cs
- AuthStoreRoleProvider.cs
- PersonalizationEntry.cs
- LogReservationCollection.cs
- BufferAllocator.cs
- HostDesigntimeLicenseContext.cs
- StringValidatorAttribute.cs
- ItemCheckEvent.cs
- GPRECT.cs
- ToolStripDropDownClosingEventArgs.cs
- PageScaling.cs
- DefaultPropertyAttribute.cs
- ControlCodeDomSerializer.cs
- AppSecurityManager.cs
- SymbolTable.cs
- GridViewDeleteEventArgs.cs
- HideDisabledControlAdapter.cs
- PathGeometry.cs
- PropertyMetadata.cs
- ColorAnimation.cs
- DataGridViewCellLinkedList.cs
- TypeExtensionConverter.cs
- Logging.cs
- QuadTree.cs
- EncoderBestFitFallback.cs
- TextTreeTextBlock.cs
- LoginCancelEventArgs.cs
- RangeValuePattern.cs
- ConstantExpression.cs
- SelectionListComponentEditor.cs
- DataGridCaption.cs
- WebPartAddingEventArgs.cs
- Restrictions.cs
- RankException.cs
- WebReferencesBuildProvider.cs
- ToolStripItemClickedEventArgs.cs
- HostAdapter.cs
- HtmlControl.cs
- SqlDataSourceCommandEventArgs.cs
- PathFigure.cs
- DataControlImageButton.cs
- TextSelectionHelper.cs
- WpfXamlType.cs
- Window.cs
- TableStyle.cs
- TraceUtility.cs
- LambdaCompiler.Address.cs
- ValidationUtility.cs
- DataGridViewLayoutData.cs
- UrlMappingsModule.cs
- HeaderCollection.cs
- IgnoreSectionHandler.cs
- OdbcEnvironment.cs
- _AutoWebProxyScriptEngine.cs
- validation.cs
- XmlQueryCardinality.cs
- GridViewSortEventArgs.cs
- ResXResourceSet.cs
- SchemaDeclBase.cs
- DrawingAttributesDefaultValueFactory.cs
- ServicePointManagerElement.cs
- securestring.cs
- CacheMode.cs
- WebServiceTypeData.cs
- BitmapEffectOutputConnector.cs
- DataGridItemEventArgs.cs