zoukankan      html  css  js  c++  java
  • & replace &

    var decoded = encoded.replace(/&/g,'&');

    http://stackoverflow.com/questions/3700326/decode-amp-back-to-in-javascript

    Technically, and often in practice, the up-voted answer is not correct.

    Uri.EscapeUriString or HttpUtility.UrlPathEncode is the correct way to escape a string meant to be part of a URL.

    Take for example the string "Stack Overflow":

    • HttpUtility.UrlEncode("Stack Overflow") --> "Stack+Overflow"

    • Uri.EscapeUriString("Stack Overflow") --> "Stack%20Overflow"

    • Uri.EscapeDataString("Stack + Overflow") --> Also encodes "+" to "%2b" ---->Stack%20%2B%20%20Overflow

  • 相关阅读:
    HDU
    HDU
    POJ
    HDU
    HDU
    POJ
    HDU
    FZU
    LightOJ 1030 Discovering Gold 数学期望计算
    POJ 3061 Subsequence 二分查找
  • 原文地址:https://www.cnblogs.com/zwei1121/p/3696997.html
Copyright © 2011-2022 走看看