I want to convert a string to an url and, instead of a space, it needs a "+" between the keywords.
For instance:
"Hello I am"
to:
"Hello+I+am"
How should i do this?
For URLs, I strongly suggest to use Server.UrlEncode (in ASP.NET) or Uri.EscapeUriString (everywhere else) instead of String.Replace.
String input = "Hello I am";
string output = input.Replace(" ", "+");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With