I guess the split converts only the caps in the $B and then I print the non_exmpty strings. Please let me know where I am totally wrong. I thought the $A was discontinuous, but the order of the characters remained the same and hence thought I could do it this way.