Skip to Main Content

Defanging an IP Address

Problem URL:Defanging an IP Address

My Solution

JavaScript

/**
 * @param {string} address
 * @return {string}
 */

const defangIPaddr = (address) => {
  return address.split(".").join("[.]");
};

Let's Connect

Twitter GitHub LinkedIn