Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
public class Program
{
public static void Main()
{
decimal value = 123456.7890m;
@vgerbase
vgerbase / VisualStudio-WinMerge.md
Last active November 5, 2019 14:59
Configure Visual Studio to use WinMerge

Configure Visual Studio to use WinMerge

  • Open Source Control > Visual Studio Team Foundation under the Tools > Options... menu in Visual Studio
  • Click on Configure User Tools...
  • Click Add.. and fill the information below to configure the Compare operation
Extension: .*
Operation: Compare
Command: C:\Program Files\WinMerge\WinMergeU.exe
@vgerbase
vgerbase / ToXml.cs
Created May 26, 2020 16:44
Serialize object to XML in Visual Studio immediate window while debugging
(new System.Xml.Serialization.XmlSerializer(obj.GetType())).Serialize(new System.IO.StreamWriter(@"C:\Temp\obj.xml"), obj)
@vgerbase
vgerbase / simplest-way-to-form-a-union-of-two-lists.md
Last active June 15, 2020 15:02
Simplest way to form a union of two lists

If it is a list, you can also use AddRange method.

var listB = new List<int>{3, 4, 5};  
var listA = new List<int>{1, 2, 3, 4, 5};
listA.AddRange(listB); // listA now has elements of listB also.

If you need new list (and exclude the duplicate), you can use Union.