public static string ToString(XmlNodeList nodes) { StringBuilder sb = new StringBuilder(); try { foreach (XmlNode node in nodes) { sb.AppendLine(node.OuterXml); } string s = "<Root>" + sb.ToString() + "</Root>"; s = Indent(s); s = UStr.TrimStart(s, "<Root>"); s = UStr.TrimEnd(s, "</Root>"); return(s); } catch { return(""); } }
public static string Delimited(string delimiter, params object[] vals) { string s = ""; foreach (object val in vals) { s += val.ToString() + delimiter; } return(UStr.TrimEnd(s, delimiter)); }
public static string Join(string sep1, string sep2, params object[] s) { string ret = ""; bool s1 = false; if (s == null) { return(""); } foreach (object v in s) { s1 = !s1; if (v != null) { ret += v.ToString() + (s1 ? sep1 : sep2); } } return(UStr.TrimEnd(ret, s1 ? sep1 : sep2)); }
public static string TrimAnd(string filter) { filter = UStr.TrimEnd(filter, " AND "); return(filter); }
public static string TrimOr(string filter) { filter = UStr.TrimEnd(filter, " OR "); return(filter); }