Skip to content

Instantly share code, notes, and snippets.

@bugrym
Created February 20, 2020 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bugrym/122eb682c89455a262dadaf5978546cf to your computer and use it in GitHub Desktop.
Save bugrym/122eb682c89455a262dadaf5978546cf to your computer and use it in GitHub Desktop.
1108. Defanging an IP Address
func defangIPaddr(_ address: String) -> String {
return address.replacingOccurrences(of: ".", with: "[.]")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment