/// <summary> /// Returns a humanize string with a formatter that represents the current <see cref="ReadOnlySpan{T}"/>. /// </summary> /// <typeparam name="T">The type of each element.</typeparam> /// <param name="span">The current span.</param> /// <param name="formatter">The formatter.</param> /// <returns>A humanize string.</returns> public static string ToStringEx <T>(this ReadOnlySpan <T> span, ISpanFormatterEx <T> formatter) { if (formatter != null) { return(formatter.Format(span)); } else { return(span.ToStringEx()); } }
/// <summary> /// Returns a humanize string with a formatter that represents the current <see cref="Span{T}"/>. /// </summary> /// <typeparam name="T">The type of each element.</typeparam> /// <param name="span">The current span.</param> /// <param name="formatter">The formatter.</param> /// <returns>A humanize string.</returns> public static string ToStringEx <T>(this Span <T> span, ISpanFormatterEx <T> formatter) => ((ReadOnlySpan <T>)span).ToStringEx(formatter);