Leetcode Note: Go - Defanging an IP Address

Defanging an IP Address - LeetCode
https://leetcode.com/problems/defanging-an-ip-address/

  • Go 言語で取り組んだメモ

回答

[C/C++/Java/Python/C#/PHP/Ruby/JS/TS/Go/Rust/Swift] regex and replace - LeetCode Discuss
https://leetcode.com/problems/defanging-an-ip-address/discuss/442529/CC%2B%2BJavaPythonCPHPRubyJSTSGoRustSwift-regex-and-replace

func defangIPaddr(a string) string {
    return strings.Replace(a, ".", "[.]", -1)
}