Defanged Version of Internet Protocol Address | C # implementation to find the defanged version of the IP address ; Function to generate a defanged version of IP address . ; Loop to iterate over the characters of the string ; Driver Code
using System ; class GFG { static String GeberateDefangIP ( string str ) { string defangIP = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) { char c = str [ i ] ; if ( c == ' . ' ) { defangIP += " [ . ] " ; } else { defangIP += c ; } } return defangIP ; } public static void Main ( ) { string str = "255.100.50.0" ; Console . Write ( GeberateDefangIP ( str ) ) ; } }