/// <summary> /// Return a JSON representation of the given internationalized string. /// </summary> /// <param name="I18NString">An internationalized string.</param> /// <param name="JPropertyKey">The name of the JSON property key.</param> public static JProperty ToJSON(this I18NString I18NString, String JPropertyKey) { if (I18NString == null || !I18NString.Any()) { return(null); } return(new JProperty(JPropertyKey, I18NString.ToJSON())); }
/// <summary> /// Return the first string of a multi-language string. /// </summary> public static String FirstText(this I18NString Text) => Text != null && Text.Any() ? Text.First().Text : null;
/// <summary> /// The multi-language string is neither null nor empty. /// </summary> public static Boolean IsNeitherNullNorEmpty(this I18NString Text) => Text != null && Text.Any();
/// <summary> /// The multi-language string is empty. /// </summary> public static Boolean IsNullOrEmpty(this I18NString Text) => Text == null || !Text.Any();
/// <summary> /// The I18N text is not empty. /// </summary> public static Boolean IsNotNullOrEmpty(this I18NString Text) => Text != null && Text.Any();