CSharp examples for System:String SubString
Returns suffixed if value is present. Else returns empty string.
using System;// w ww . j a v a 2s.c o m public class Main{ /// <summary> /// Returns suffixed if value is present. Else returns empty string. /// </summary> public static string AppendIfIs( this string value, string suffix) { return value.Is() ? value + suffix : String.Empty; } /// <summary> /// Returns true if string is NOT (null or empty) /// </summary> public static bool Is(this string source) { return !String.IsNullOrEmpty(source); } }