Replaces string with character array