Browsing 7239 questions and answers with Jon Skeet
Sounds like a good candidate for Regex.Replace: private static readonly Regex RemovalRegex = new Regex(@"\s|[().]"); ... public static string RemoveUnwantedCharacters(string input) { return RemovalRegex.Replace(input, ""); } Note... more 8/27/2015 10:34:19 AM
But For Characters Upper Than 128 I get Irrelevant answers No you don't. You get the bottom 8 bits of the UTF-16 code unit corresponding to the char. Now if your text were all ASCII, that would be fine - because ASCII only goes up to... more 8/27/2015 5:50:12 AM
The == operator only checks reference equality. It doesn't call any methods on the object... it just checks whether the two references involved are equal, i.e. they refer to the same object. In simple cases I believe this is just a matter... more 8/27/2015 5:47:10 AM
Look at this loop: while ((alphabets.getAlp().equalsIgnoreCase(arrayList.get(i).substring(0, 1))) && (i < count)) { str.add(arrayList.get(i)); i++; } Note how you call arrayList.get(i) before you check for i <... more 8/26/2015 5:42:43 PM
If you just need a Stream to deserialize from, you can use: var stream = new MemoryStream(buffer.Array, buffer.Offset, result.Count); ArraySegment<byte> is already wrapping a byte[], so you just need to create a MemoryStream... more 8/26/2015 4:33:03 PM
There's nothing wrong there at all. It's using an object initializer for End which sets properties using the existing value instead of assigning a new value to End. Your code is equivalent to: var tmp0 = new MyClass(); var tmp1 = new... more 8/26/2015 2:52:17 PM
Given that your current query returns elements with key/date/count, it sounds like you probably just want: var result = query.GroupBy( x => x.Key, (key, rows) => new Data { Key = key, Val = rows.Select(r =>... more 8/26/2015 12:24:33 PM
In a LINQ query expression you just need multiple from clauses, e.g. var query = from row1 in tab1 from row2 in tab2 from row3 in tab3 select new { row1, row2, row3 }; If you don't want to use query... more 8/26/2015 12:02:57 PM
When I tried this with WebClient, I didn't get a 403, but an exception: System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine Looking up other questions with the same error, I found that the... more 8/26/2015 10:19:33 AM
The unit test shows the same result as I see when executing the code. Here's a short but complete program to show the exact result retrieved, using my DoubleConverter class. using System; class Test { static void Main() { ... more 8/26/2015 9:29:44 AM