Parse string to URL

前端 未结 2 586
终归单人心
终归单人心 2020-12-03 07:53

How can I parse dynamic string values in order to create URL instances? I need to replace spaces with %20, accents, non-ASCII characters...?

I tried to

2条回答
  •  我在风中等你
    2020-12-03 08:43

    So what you're saying is that you want to encode part of your URL but not the whole thing. Sounds to me like you'll have to break it up into parts, pass the ones that you want encoded through the encoder, and re-assemble it to get your whole URL.

提交回复
热议问题