This program takes string like that 192.168.1.125 and cut every number then converts it to integer, but it returns an error.
import java.lang.String;
import java.lang.Number;
import java.lang.Integer;
class Ip
{
public static void main ( String [] args )
{
int i ;
i = args[0].indexOf ( '.' );
do
{
if ( i != -1 )
args[0].substring ( 0, i );
String str = args[0].substring ( i + 1, args[0].length() );
String str2 = Integer.parseInt ( str );
System.out.println ( str2 );
}
while ( i != -1 );
}
}