IsNullOrEmptyThenValue
public static string IsNullOrEmptyThenValue(this string str, string value) { if (string.IsNullOrEmpty(str)) return value; else return str; }Example:
"".IsNullOrEmptyThenValue("mohsen") = "mohsen" "ali".IsNullOrEmptyThenValue("mohsen") = "ali"
Description
برای حل مشکل مقدار پیشفرض وقتی مقداری وجود ندارد
Details
- Author: سید محسن میرشاهرضا
- Submitted on: 6/9/2014 9:07:57 AM
- Language: C#
- Type: System.String
- Views: 2422
Double click on the code to select all.