File.WriteAll-Input string was not in the correct format

Hello everyone,
I have this issue with the following code:

System.IO.File.WriteAllText ("file://" + Application.dataPath.Replace("/Documents/Ez 5 ez life/Assets", "/Desktop") + "/copyable.txt", chatTxt.text.ToString());

I put in some debug code and the path and everything is how it should be, now the problem is when i run this code in my chat i get the following error: Input string was not in the correct format

I tried googleing for a solution but no such error is related to this…
I have no idea why it won’t create the file and write the text… Please help…

You don’t need “file://”

System.IO.File.WriteAllText ( Application.dataPath.Replace("/Documents/Ez 5 ez life/Assets", "/Desktop") + "/copyable.txt", chatTxt.text.ToString());