Esempio n. 1
0
        public static string DictionaryToString(Dictionary <string, string> attributes, char seperator)
        {
            var builder = new StringBuilder();

            if (attributes != null && attributes.Count > 0)
            {
                foreach (var key in attributes.Keys)
                {
                    builder.Append(
                        $@"{StringUtils.ValueToUrl(key)}={StringUtils.ValueToUrl(attributes[key])}{seperator}");
                }
                builder.Length--;
            }
            return(builder.ToString());
        }
Esempio n. 2
0
        public static string NameValueCollectionToString(LowerNameValueCollection attributes, char seperator)
        {
            if (attributes == null || attributes.Count <= 0)
            {
                return(string.Empty);
            }

            var builder = new StringBuilder();

            foreach (var key in attributes.Keys)
            {
                builder.Append(
                    $@"{StringUtils.ValueToUrl(key)}={StringUtils.ValueToUrl(attributes.Get(key))}{seperator}");
            }
            builder.Length--;
            return(builder.ToString());
        }