I have a list of lists of strings like:
example = [["string 1", "a\r\ntest string:"],["string 1", "test 2: another\r\ntest string"]]
I'd like to replace the "\r\n"
with a space (and strip off the ":"
at the end for all the strings).
For a normal list I would use list comprehension to strip or replace an item like
example = [x.replace('\r\n','') for x in example]
or even a lambda function
map(lambda x: str.replace(x, '\r\n', ''),example)
but I can't get it to work for a nested list. Any suggestions?