Defanging an IP Address
Return the string you get by replacing every . in address with [.].
Example 1
address "1.1.1.1"
returns "1[.]1[.]1[.]1"
Each dot becomes [.]: 1[.]1[.]1[.]1.
Constraints
addressis a valid IPv4 address with digits and three dots
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Strings problems
- Determine if String Halves Are AlikeBeginner
- Find Words Containing CharacterBeginner
- Join the Non-Empty PartsBeginner
- Longest Vowel RunBeginner
- Longest Word in a SentenceBeginner
- Maximum Nesting Depth of ParenthesesBeginner
- Mirror CipherBeginner
- One Segment of OnesBeginner