Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Contains with empty string
Message
From
18/07/2014 09:50:56
 
 
To
18/07/2014 09:48:48
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01604011
Message ID:
01604036
Views:
33
Hmm. That would have to be IsEmptyOrIsContainedBy :-}

>Or IsEmptyOrContains to be consistent with current methods.
>
>>I guess you're right. It would me more consistent with other String methods. TBH I don't really like either in that they are not truly descriptive of what the method does :-{
>>
>>Maybe swap it around :
public static bool IsEmptyOrIn(this String str, string longsString)
>>        {
>>            return string.IsNullOrEmpty(str) || longsString.Contains(str);
>>        }
>>       // with
>>      var x = ShortString.IsEmptyOrIn(LongString);
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform