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
- UInt32.cs
- DataGridTextBoxColumn.cs
- CanonicalFontFamilyReference.cs
- FontNamesConverter.cs
- WsrmMessageInfo.cs
- ApplicationInfo.cs
- XmlIncludeAttribute.cs
- ViewGenerator.cs
- ByteAnimationUsingKeyFrames.cs
- ReadOnlyAttribute.cs
- StylusShape.cs
- ParameterEditorUserControl.cs
- CodeCommentStatement.cs
- __FastResourceComparer.cs
- DataKeyPropertyAttribute.cs
- RotateTransform3D.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- SamlAuthorizationDecisionClaimResource.cs
- EventLogger.cs
- Helper.cs
- DispatcherExceptionEventArgs.cs
- Cursors.cs
- ObjectViewFactory.cs
- EtwTrace.cs
- TemplateBuilder.cs
- PasswordRecovery.cs
- PropertyDescriptors.cs
- UseManagedPresentationBindingElementImporter.cs
- WindowsGraphicsWrapper.cs
- IPGlobalProperties.cs
- DataGridSortCommandEventArgs.cs
- StackOverflowException.cs
- DragEventArgs.cs
- DataSourceIDConverter.cs
- IxmlLineInfo.cs
- EmptyControlCollection.cs
- AssemblyResourceLoader.cs
- ListViewTableRow.cs
- HtmlControlPersistable.cs
- StrokeNode.cs
- XmlSchemaExternal.cs
- ObjectContext.cs
- MachineSettingsSection.cs
- ProxyWebPartConnectionCollection.cs
- NotifyInputEventArgs.cs
- IntSecurity.cs
- FirstQueryOperator.cs
- HashAlgorithm.cs
- NativeRecognizer.cs
- TextMessageEncodingElement.cs
- xml.cs
- Crc32.cs
- UnicodeEncoding.cs
- ToolStripComboBox.cs
- FormCollection.cs
- Context.cs
- VariableValue.cs
- URLMembershipCondition.cs
- Trace.cs
- StyleXamlParser.cs
- EntitySetRetriever.cs
- SchemaReference.cs
- SmiXetterAccessMap.cs
- ErrorWrapper.cs
- OledbConnectionStringbuilder.cs
- TreeViewItem.cs
- StrongNameIdentityPermission.cs
- PersonalizationStateInfo.cs
- CodeMemberField.cs
- SevenBitStream.cs
- LocalizationComments.cs
- CodeTypeConstructor.cs
- ContentTextAutomationPeer.cs
- LowerCaseStringConverter.cs
- LinkTarget.cs
- NamedPipeChannelListener.cs
- ParameterExpression.cs
- SqlFlattener.cs
- RotateTransform.cs
- Stream.cs
- SourceFilter.cs
- MailMessageEventArgs.cs
- SoapRpcServiceAttribute.cs
- CodeDomDesignerLoader.cs
- DBDataPermission.cs
- XPathDocumentBuilder.cs
- ControlDesigner.cs
- ExceptionWrapper.cs
- ProfileManager.cs
- SafeRegistryKey.cs
- SqlStatistics.cs
- WebPartUtil.cs
- StringWriter.cs
- VariableAction.cs
- OdbcConnectionFactory.cs
- MethodRental.cs
- Pair.cs
- ResourceExpressionBuilder.cs
- safesecurityhelperavalon.cs
- TreeChangeInfo.cs