LeetCode-1108 Defanging an IP Address Solution (with Java)

1. Description:

Notes:

2. Examples:

3.Solutions:

1 public String defangIPaddr(String address) {
2            return address.replace(".", "[.]");   
3     }

4. Summary:

  • 字符串替换函数: replace(string origin, string newString)

 

posted @ 2020-03-02 13:03  SheepCore  阅读(129)  评论(0编辑  收藏  举报