URLify a given string Python

PROGRAM TO URLify A GIVEN STRING



# Instantiate the string
s = "Mr John Smith "
 
# Trim the given string
s = s.strip()
 
# Replace All space (unicode is \\s) to %20
s = s.replace(' ', "%20")
 
# Display the result
print(s)

OUTPUT
Mr%20John%20Smith

Comments

Popular posts from this blog

Solve the Sudoku Python

Solve the Sudoku Java

Find Duplicates Java