format code of string