Format strings in trigrammes