It works very nicely, but just a little bug. It takes C into account when using $len. I would use $remove to remove character C from the output. =)