Select two consecutive digits and call the same function for other blocks
if ( givenString . size ( ) < index + 2 givenString [ index ] == '0' ) return ; ipAddress = ipAddress + givenString . substr ( index , 2 ) + ' . ' ; GetAllValidIpAddress ( result , givenString , index + 2 , count + 1 , ipAddress ) ;