mirror of https://github.com/01-edu/public.git
46f4ddc49e | ||
---|---|---|
.. | ||
README.md |
README.md
to_url
Instructions
Define a function called to_url
that takes a string and substitutes every white-space with '%20'.
Expected Function
pub fn to_url(s: &str) -> String {
}
Usage
Here is a program to test your function.
use to_url::*;
fn main() {
let s = "Hello, world!";
println!("{} to be use as an url is {}", s, to_url(s));
}
And its output
$ cargo run
Hello, world! to be use as an url is Hello,%20world!
$