Snippet
Visual Studio Code Formatting
Control how Visual Studio formats your C# code and format a whole document with one shortcut.
1 min read#C##Visual Studio
Articles, code snippets and news worth sharing.
Control how Visual Studio formats your C# code and format a whole document with one shortcut.
Split a string on a delimiter using the built-in JavaScript split function.
var split = 'john smith#5551234567'.split('#');
var name = split[0]; // john smith
var mobile = split[1]; // 5551234567Remove duplicate options from a select element with a short jQuery loop.
var usedDisplayNames = {};
$("select[name='tagname'] > option").each(function () {
if (usedDisplayNames[this.text]) {
$(this).remove();
} else {
usedDisplayNames[this.text] = this.value;Join the values of an Excel column into one comma separated string using a simple running formula.
B2 = A1 & ", " & A2
B3 = B2 & ", " & A3The syntax of class inheritance in C# and the main rules to remember.
class A
{
int aVariable;
public A()
{
}A T-SQL user defined function that converts text to proper case, capitalising the first letter of every word.
CREATE FUNCTION ProperCase(@inpStr nvarchar(8000))
RETURNS nvarchar(8000) AS
BEGIN
DECLARE @Result nvarchar(8000)
SET @inpStr = LOWER(@inpStr) + ' '
SET @Result = ''