Or
public static string Or(this string input, string alternative) { return (string.IsNullOrEmpty(input)==false) ? input : alternative; }Example:
string someResult = someString1.Or(someString2).Or("foo");
Description
Returns the first string with a non-empty non-null value.
Details
- Author: Phil Campbell
- Submitted on: 25-10-2013 22:56:19
- Language: C#
- Type: System.String
- Views: 3145
Double click on the code to select all.