We could concatenate the a ' s ▁ left ▁ part ▁ + b ' s right part in a variable a and a ' s ▁ right ▁ part + b ' s left in the variable b
String xa = a . substring ( i , j + 1 ) ; String xb = b . substring ( i , j + 1 ) ;