Browsing 7239 questions and answers with Jon Skeet
The value is an array, but your field is a string. I suggest you make it an array (or list) of the appropriate type - we can't tell what that type would be from your JSON, but perhaps you want a string array? I'd also suggest using... more 5/25/2017 4:29:20 PM
The problem is what you're doing with the end of the decryption: return Convert.ToBase64String(buffer); You actually want to convert the decrypted binary data back into a string in a way that mirrors the original way you converted it... more 5/25/2017 12:42:22 PM
I believe the problem is that the compiler can't know the type of the expression _valueProvider?.Value. Let's simplify this a bit: public interface IValueProvider<T> { T Value { get; } } public class Test { public static... more 5/25/2017 7:38:58 AM
It looks like the capability is there, just in a more roundabout way. Instead of: string output = input.ToLower(culture); use string output = culture.TextInfo.ToLower(input); Also note that the overload has been added in... more 5/24/2017 10:51:16 AM
You shouldn't be trying to parse it as a ZonedDateTime, as it really doesn't have a time zone - it has a UTC offset. OffsetDateTime is more appropriate here. It's worth differentiating between the two types - you can create a ZonedDateTime... more 5/24/2017 10:24:38 AM
You made an unfortunate choice to test with, basically - "weeks" isn't an independent unit; it's just a shorthand for 7 days. From the docs for ofWeeks: The resulting period will be day-based, with the amount of days equal to the... more 5/24/2017 10:06:48 AM
Am I making some mistake in my commands? Yes - you're not including anything apart from C.jar when trying to run. Use java -cp C.jar;. // Windows java -cp C.jar:. // Unix So that you're including the current directory (which is... more 5/24/2017 7:46:34 AM
I'm surprised it works in Unity - it shouldn't. That sounds like a Mono compiler bug. The C# 5 specification isn't as clear on this as it should be, but from the draft of the upcoming ECMA C# 5 standard, from the clause on method group... more 5/24/2017 6:06:34 AM
You don't want to do this to the whole file in one go - you need a streaming approach. I'd do something like this: // TODO: Rename to something more appropriate public static void replaceInvalidCharacters(Reader reader, Writer writer) { ... more 5/23/2017 1:33:50 PM
A Date object doesn't have any state representing a format. It's just an instant in time. If you've got the right value in date1, then formatting and parsing it is completely pointless. Instead, when you want the Date in a particular... more 5/23/2017 12:25:55 PM