How join a list of raw strings? [closed]

Use the \ escape character.

list_str = ["first_string", "\\nsecond_string"]
join_str = ",".join(list_str)
print(join_str)

Output: first_string,\nsecond_string

Browse More Popular Posts

Leave a Comment