Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / StringUtil.cs / 3 / StringUtil.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //----------------------------------------------------------------------------- namespace System.Data.Design { using System; using System.Diagnostics; using System.Globalization; ////// This class stores some common used string utility functions /// used by any class in this dll. /// internal sealed class StringUtil { ////// Private contstructor to avoid class being instantiated. /// private StringUtil() { } ////// Checks to see if the string is empty or null /// ////// true if the string is empty and not null /// internal static bool Empty(string str) { return ((null == str) || (0 >= str.Length)); } ////// Checks to see if the string is empty or null or only contains spaces /// ////// true if the string is not empty and not null /// internal static bool EmptyOrSpace(string str) { return ((null == str) || (0 >= (str.Trim()).Length)); } ////// Compare two strings with invariant culture and case sensitive /// Also consider the null cases /// internal static bool EqualValue(string str1, string str2){ return EqualValue(str1, str2, false); } ////// Compare two strings with invariant culture and specified case sensitivity /// Also consider the null cases /// internal static bool EqualValue(string str1, string str2, bool caseInsensitive){ if((str1 != null) && (str2 != null)) { StringComparison compararison = caseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; return String.Equals(str1, str2, compararison); } return str1 == str2; } ////// We need this function as the VSDesigner.Data.DesignUtil has this one /// We want the change ove to be seamless. /// internal static bool NotEmpty(string str) { return !Empty(str); } ////// Check the string is empty or null /// ////// true if the string is not empty and not null /// public static bool NotEmptyAfterTrim(string str) { return !EmptyOrSpace(str); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProtocolsConfigurationHandler.cs
- ConnectorRouter.cs
- TimeZoneNotFoundException.cs
- Point3DCollection.cs
- FixedSOMPageElement.cs
- SqlStream.cs
- InputElement.cs
- ServiceObjectContainer.cs
- Hashtable.cs
- LazyInitializer.cs
- ValueTypeFixupInfo.cs
- OutputCacheModule.cs
- DbConnectionPool.cs
- ViewGenResults.cs
- LinearKeyFrames.cs
- CompilerCollection.cs
- PreservationFileReader.cs
- XmlChoiceIdentifierAttribute.cs
- XamlBrushSerializer.cs
- PeerNearMe.cs
- SecurityTokenContainer.cs
- AccessedThroughPropertyAttribute.cs
- SmiConnection.cs
- MediaScriptCommandRoutedEventArgs.cs
- Int32AnimationUsingKeyFrames.cs
- AttributeEmitter.cs
- Privilege.cs
- CfgParser.cs
- HyperLink.cs
- ProxyWebPartManager.cs
- dtdvalidator.cs
- ConnectionOrientedTransportChannelFactory.cs
- ObjectTag.cs
- SafeNativeMethods.cs
- ExceptionUtility.cs
- AudioLevelUpdatedEventArgs.cs
- EventPrivateKey.cs
- DataGridViewCellEventArgs.cs
- ChannelSinkStacks.cs
- filewebrequest.cs
- NameSpaceExtractor.cs
- StyleXamlTreeBuilder.cs
- DataBoundControlDesigner.cs
- ServiceBuildProvider.cs
- UserMapPath.cs
- Pair.cs
- BinaryExpression.cs
- PageOrientation.cs
- OdbcHandle.cs
- Renderer.cs
- XmlDataSource.cs
- TreeNode.cs
- InternalBufferManager.cs
- BitmapSource.cs
- Volatile.cs
- ByteAnimationUsingKeyFrames.cs
- SchemaElementDecl.cs
- Label.cs
- XmlChoiceIdentifierAttribute.cs
- SmtpLoginAuthenticationModule.cs
- FilterException.cs
- ConnectionPointConverter.cs
- DBSchemaTable.cs
- Processor.cs
- SqlBulkCopy.cs
- WorkflowTransactionOptions.cs
- SizeChangedEventArgs.cs
- SecondaryViewProvider.cs
- DataViewManager.cs
- TileBrush.cs
- TextTreeUndo.cs
- ColumnHeader.cs
- InternalBufferOverflowException.cs
- _DigestClient.cs
- StorageMappingItemLoader.cs
- KeyGestureConverter.cs
- DashStyle.cs
- ArrayConverter.cs
- COAUTHIDENTITY.cs
- BuilderInfo.cs
- XmlWellformedWriter.cs
- updatecommandorderer.cs
- ServiceOperation.cs
- JavaScriptString.cs
- ContentControl.cs
- MessageQueueKey.cs
- RetrieveVirtualItemEventArgs.cs
- ForwardPositionQuery.cs
- StackBuilderSink.cs
- AssemblyHash.cs
- TreeViewItemAutomationPeer.cs
- DataSetMappper.cs
- SQLMembershipProvider.cs
- TaiwanLunisolarCalendar.cs
- XmlProcessingInstruction.cs
- PeerResolverSettings.cs
- ObjectViewEntityCollectionData.cs
- RuleSetDialog.cs
- TextEditorCharacters.cs
- RelationshipDetailsCollection.cs