1108. Defanging an IP Address
Question
Given a valid (IPv4) IP
address
, return a defanged version of that IP address.A defanged IP address replaces every period
"."
with"[.]"
.
Solution
迭代每个字符,用StringBuffer类来组成新的字符串。
Code
1 | class Solution { |
1108. Defanging an IP Address
https://xuanhe95.github.io/2022/06/21/1108-Defanging-an-IP-Address/