Browsing 7239 questions and answers with Jon Skeet
You're missing precedence, basically. It's easier to see what's going on when this is reduced to a minimal example: using System; public class Program { public static void Main() { string[] a = { "x", "y" }; ... more 8/18/2017 10:45:11 AM
Now there's a problem. Now arr doesn't get anything and s reads the whole line including the first 4 letters. Yes, that seems very plausible. StreamReader maintains a buffer - when you ask it to read a line of text, it may well read... more 8/18/2017 7:32:22 AM
I would suggest you change your approach: Generate a point for the North/West corner, anywhere in the appropriate range Generate the width and height, ensuring they're positive Set East = West + Width, and South = North - Height more 8/18/2017 6:29:52 AM
Just pass it as the array: String[] array = { "Some", "arguments", "I", "prepared", "earlier" }; passStrings(array); A varargs parameter like arg is still an array parameter really - it's just that the compiler allows you to specify the... more 8/18/2017 6:04:05 AM
It sounds like installing the VS2017 update for that specific version didn't also install the .NET Core 2.0 SDK. You can download that here. To check which version of the SDK you've already got installed, run dotnet --info from the... more 8/17/2017 2:22:58 PM
Is there a better way to achieve what I want? Absolutely - in both .NET and in Java, in fact. In .NET I'd (in a biased way) recommend using Noda Time so you can represent just a time of day as a LocalTime, parsing precisely the... more 8/16/2017 12:27:05 PM
Sure - do exactly as the compiler says - cast the lambda expression to a concrete type: Calc(obj, (Action<int>)(result => Console.Write("Result: " + result))); The reason you have to do this is that a lambda expression doesn't... more 8/15/2017 4:00:54 PM
I see three options, although there are others: You could explicitly declare the type of variable you want, in which case you can initialize it separately in each case: IQueryable<LinqToExcel.Row> discounts; if... more 8/15/2017 3:26:29 PM
The documentation explains the difference: The common language runtime makes a distinction between vectors (that is, one-dimensional arrays that are always zero-based) and multidimensional arrays. A vector, which always has only one... more 8/15/2017 1:33:19 PM
What framework should my projects target to be able to work together? Can we upgrade just one project to .NET Core and keep the rest in .NET Framework? You don't need to make any of your projects target .NET Core in order to use... more 8/15/2017 1:00:41 PM