Пример #1
0
        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("");
            }
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        public static string TrimAnd(string filter)
        {
            filter = UStr.TrimEnd(filter, " AND ");

            return(filter);
        }
Пример #5
0
        public static string TrimOr(string filter)
        {
            filter = UStr.TrimEnd(filter, " OR ");

            return(filter);
        }