URLify a given string
URLify a given string
Solutions
Approach 1 – Using string replace method
public string URLify(string str)
{
if (str is null)
return str;
str= str.Trim();
return str.Replace(" ", "%20");
}Approach 2 – Using two-scan approach.
Last updated