从网址中删除空格 [英] remove space from the url

查看:73
本文介绍了从网址中删除空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家



可以请任何建议我删除空间



Hi Experts

Can any please suggested me to remove space "

<a href="http://brakeworld.com/CatalogDisplay.aspx?y=2007&amp;m=FORD&amp;mod=F350%202WD%20(1%20TON)%20AND%20SUPERDUTY"></a>







我想从网址中删除%20 / ./.




I would like to remove %20 from the url /./.

推荐答案

System.Web.HttpUtility.UrlPathEncode(string str);
System.Web.HttpUtility.UrlPathEncode(string str);


使用类似
的功能


Use function like

public static String XHTMLDecode(String Input)
        {
            if (!string.IsNullOrEmpty(Input))
            {
                Input = HttpUtility.HtmlDecode(Input);
                return Input.Replace("&", "&#38;").Replace("&amp;amp;", "&#38;").Replace("<", "&#60;").Replace(">", "&#62;").Replace("\"", "&#34;");
            }
            else
            {
                return string.Empty;
            }

        }


这篇关于从网址中删除空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆