Is there an existing package/function for formatting a string into a valid url?
For instance, replacing spaces with %20
:
julia> str = "https://julialang.zulipchat.com/word1 word2.com"
"https://julialang.zulipchat.com/word1 word2.com"
julia> url = replace(str, " " => "%20")
"https://julialang.zulipchat.com/word1%20word2.com"
HTTP.jl has this functionality in it's URI module
https://juliaweb.github.io/HTTP.jl/stable/public_interface/#URIs.escapeuri
URIs.jl is a package by itself, and HTTP.jl re-exports that functionality from it. So you can directly add URIs
if you don't need other functionality from HTTP.jl.
Yakir Luc Gagnon has marked this topic as resolved.
Last updated: Dec 28 2024 at 04:38 UTC