/// <summary> /// ToString function is to be used with a matrix of strings. For example an array of instances of an array of strings. /// </summary> /// <param name="context"></param> /// <returns></returns> public static string ToString(StringArrayFunc2 context) { var w = new StringBuilder(); var next = context(); var k = next(); w.AppendLine("["); while (k != null) { w.Append("["); for (int i = 0; i < k.Length; i++) { if (i > 0) { w.Append(","); } w.Append("\"" + k[i] + "\""); } w.Append("]"); k = next(); if (k == null) { w.AppendLine(); } else { w.AppendLine(","); } } w.AppendLine("]"); return(w.ToString()); }
/// <summary> /// ToString function is to be used with a matrix of strings. For example an array of instances of an array of strings. /// </summary> /// <param name="context"></param> /// <returns></returns> public static string ToString(StringArrayFunc2 context) { var w = new StringBuilder(); var next = context(); var k = next(); w.AppendLine("["); while (k != null) { w.Append("["); for (int i = 0; i < k.Length; i++) { if (i > 0) w.Append(","); w.Append("\"" + k[i] + "\""); } w.Append("]"); k = next(); if (k == null) w.AppendLine(); else w.AppendLine(","); } w.AppendLine("]"); return w.ToString(); }