开发者

Im getting funny % signs back how do I get rid of them?

开发者 https://www.devze.com 2023-01-31 15:09 出处:网络
Im trying to parse a response from an authentication server that is url encoded. However when I do it I am getting \\r\\n characters. And I need to not have these in my text as I need to be able to ru

Im trying to parse a response from an authentication server that is url encoded. However when I do it I am getting \r\n characters. And I need to not have these in my text as I need to be able to run a re开发者_JS百科gular expression that looks for white space but doesnt work with these escape characters.

So basically the string returned is:

ClientIP=192.168.20.31%0d%0aUrl%3d%2fflash%2f56553550_hi%3funiqueReference%3d27809666.mp4

After url decoding it it is:

192.168.20.31\r\nUrl=/flash/56553550_hi?uniqueReference=27809666.mp4

So you see I dont want it to have \r \n etc I want to have:

"192.168.20.31 Url=/flash/56553550_hi?uniqueReference=27809666.mp4"

As a verbatim string in c#.

Is this possible? Or do I have to do a string.replace on \r and replace with " "?


Either replace %0d%0a with %20 before URL decoding the string, or the \r\n with after.

Since the data exists in the original string, you can't just make it go away without replacing it.

0

精彩评论

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