/// <summary> /// Will add a space infront of capital letter words in a string /// </summary> /// <param name="attribute2nd"></param> /// <returns>string with spaces infront of capital letters</returns> public static string ToSentence(this PropertyAttribute2nd attribute2nd) { return(new string(attribute2nd.ToString().Replace("Max", "Maximum").ToCharArray().SelectMany((c, i) => i > 0 && char.IsUpper(c) ? new char[] { ' ', c } : new char[] { c }).ToArray())); }
public static string GetDescription(this PropertyAttribute2nd prop) { var description = prop.GetAttributeOfType <DescriptionAttribute>(); return(description?.Description ?? prop.ToString()); }