Remove ac and b from a string