public static string Format(string fmtString, BaseTerm args) { string result = fmtString; if (args is ListTerm) { ListTerm lt = (ListTerm)args; if (!lt.IsProperList) { return(null); } try { return(string.Format(result, lt.ToStringArray())); } catch { IO.Error("Error while applying arguments to format string '{0}'", result); } } else { try { return(string.Format(result, args.ToString().Dequoted("'").Dequoted("\""))); } catch { IO.Error("Error while applying arguments to format string '{0}'", result); } } return(null); }