Advanced string formatting