Dim URL As String = "http://foo bar/" URL = EncodeURLComponent(URL) Print(URL)