I have the following string:
mystring = '\n\nAvailability:\n Open source, \n\nResource Name:\n QIIME \n\nResource ID:\n SCR_008249'
I wanted to replace \n from the above string, but not \n\n.
So I tried this:
new_string = " ".join(mystring.split())
And found this:
'Availability: Open source, Resource Name: QIIME, Resource ID: SCR_008249'
But I wanted something like this:
'Availability: Open source,
Resource Name: QIIME Resource
ID: SCR_008249'
Thanks!