Maybe this is silly, but I'm trying to shorten the calling of the method StreamWriter.WriteLine
becasue I have to call it many times throughout my code. So, instead of calling myFile.WriteLine()
I would like to write just myFile.WL()
.
Is this possible?
After searching for a solution I wrote this:
private static void WL(this StreamWriter myFile, params string myString)
{
return (void)myFile.WriteLine(myString);
}
but I get the error
Cannot convert type 'void' to 'void'
Any ideas?