Defanged Version of Internet Protocol Address | Function to generate a defanged version of IP address . ; Loop to iterate over the characters of the string ; Driven Code
function GeberateDefangIP ( str ) { var defangIP = " " ; str . split ( ' ' ) . forEach ( function ( letter ) { ( letter == ' ' ) ? defangIP += " " : defangIP += letter ; } ) return defangIP ; } var str = " " ; document . write ( GeberateDefangIP ( str ) ) ;