Hey The very first code you provided me with is really working fine for normal strings without any non-alphabet characters except for its not working for strings which are like A[0] B[1] So please resolve this .. I tried using the fix you gave but its not working.So need to modify the code for these cases of strings also. Rest everything is really fine. And real thanks for all the innovative solutions you have provided.You really are excellent.