PivotalTrackerAPI/Util/WebEncoding.cs
/// <summary>
/// Retrieves a value by key from a UrlEncoded string.
/// </summary>
/// <param name="urlEncoded">UrlEncoded String</param>
/// <param name="key">Key to retrieve value for</param>
/// <returns>returns the value or "" if the key is not found or the value is blank</returns>
Retrieves a value by key from a UrlEncoded string.
Retrieves a value by key from a UrlEncoded string .
public static string GetUrlEncodedKey(string urlEncoded, string key)
    {
      urlEncoded = "&" + urlEncoded + "&";
      int Index = urlEncoded.IndexOf("&" + key + "=", StringComparison.OrdinalIgnoreCase);
      if (Index < 0)
        return "";
      int lnStart = Index + 2 + key.Length;
      int Index2 = urlEncoded.IndexOf("&", lnStart);
      if (Index2 < 0)
        return "";
      return UrlDecode(urlEncoded.Substring(lnStart, Index2 - lnStart));
    }
public static string GetUrlEncodedKey ( string urlEncoded , string key ) { urlEncoded = " " + urlEncoded + " " ; int Index = urlEncoded . IndexOf ( " " + key + " " , StringComparison . OrdinalIgnoreCase ) ; if ( Index < 0 ) return " " ; int lnStart = Index + 2 + key . Length ; int Index2 = urlEncoded . IndexOf ( " " , lnStart ) ; if ( Index2 < 0 ) return " " ; return UrlDecode ( urlEncoded . Substring ( lnStart , Index2 - lnStart ) ) ; }
Retrieves a value by key from a UrlEncoded string.
Retrieves a value by key from a UrlEncoded string .
returns the value or "" if the key is not found or the value is blank
returns the value or " " if the key is not found or the value is blank
urlEncoded
string
None
key
string
Key to retrieve value for
Key to retrieve value for