I have a string of characters that starts with a space and has `\r\n`,I want to delete the first space and delete `\r\n` then replace it with a comma after the word if there is a space?

My String : `"\r\n ram\r\ncomputer\r\n" ....` 

I want the following mode to change? `laptop,computer,ram`