We can split at i if one of the following two is true . a ) All characters after str [ i ] are 0 b ) String after str [ i ] is divisible by b , i . e . , str [ i + 1. . n - 1 ] is divisible by b .
if ( rl [ i + 1 ] == 0 ) { cout << " YES STRNEWLINE " ; for ( int k = 0 ; k <= i ; k ++ ) cout << str [ k ] ; cout << " , ▁ " ; for ( int k = i + 1 ; k < len ; k ++ ) cout << str [ k ] ; return ; } } cout << " NO STRNEWLINE " ; }