Remove plus sign (+) in URL query string

后端 未结 5 1779
失恋的感觉
失恋的感觉 2020-11-29 06:46

I am trying get the string in the following URL to display on my webpage.

http://example.com?ks4day=Friday+September+13th

EDIT: The date in the URL

5条回答
  •  眼角桃花
    2020-11-29 06:54

    Have you tried https://www.npmjs.com/package/querystring ?

    import { parse } from 'querystring'; 
    parse('ks4day=Friday+September+13th')
    

    returns

    { 'ks4day': 'Friday September 13th' }
    

    Assuming you are using something like Webpack that knows how to process import statements

提交回复
热议问题