开发者

Converting & to & in android?

开发者 https://www.devze.com 2022-12-22 05:22 出处:网络
I have a URL string in the following format. http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d9

I have a URL string in the following format.

http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533

I want to replace & with & in the above URL. My result should be:

http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533

Can someone post me the code to get this done?

i changed the 开发者_如何转开发code like this. but not working

if (name.equalsIgnoreCase(LINK))
{
            Log.v(TAG,"link link: "+property.getFirstChild().getNodeValue().replace("&","&"));
            message.setLink(property.getFirstChild().getNodeValue().replace("&","&"));           
        }

Thanks


How about:

private String decode(String url)
{
   return url.replace("&", "&");
}


Decode:

Html.fromHtml((String) htmlCode).toString();

Encode:

TextUtils.htmlEncode(url)


String.replace(target, replacement)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号