Access modifiers in C#

Access modifiers in C#:

public, protected, internal, and private.

Public access means accessible by any code.

Protected access enables access for all derived classes.

Internal access enables access from any code in the same assembly.

Private access is limited to code in the same class.

Happy Coding:)

SQL Server

Replace multiple space with single space – SQL Server

Replace multiple space with single space – SQL Server

DECLARE @Temp TABLE (OriginalString VARCHAR(8000))

INSERT INTO @Temp (OriginalString)
SELECT ‘ Hello. This is Hello World. ‘

SELECT REPLACE(REPLACE(REPLACE(LTRIM(RTRIM(OriginalString)), ‘ ‘, ‘ ‘ + CHAR(7)), CHAR(7) + ‘ ‘, ”), CHAR(7), ”) AS [result]
FROM @Temp
WHERE CHARINDEX(‘ ‘, OriginalString) > 0

Happy Coding:)

SQL

Split a delimited string AND LOOP through

Split a delimited string AND LOOP through

DECLARE @Id VARCHAR(50)

SET @Id = ‘51,52,61,75,95’

WHILE LEN(@Id) > 0
BEGIN
PRINT LEFT(@Id, CHARINDEX(‘,’, @Id + ‘,’) – 1)

–Your SP Code

SET @Id = STUFF(@Id, 1, CHARINDEX(‘,’, @Id + ‘,’), ”)
END

Happy Coding:)

javascript

The 10 Most Common Mistakes JavaScript Developers Make

Today, JavaScript is at the core of virtually all modern web applications. The past several years in particular have witnessed the proliferation of a wide array of powerful JavaScript-based libraries and frameworks for single page application development, graphics and animation, and even server-side JavaScript platforms.

JavaScript has truly become ubiquitous in the world of web app development and is therefore an increasingly important skill to master.

Mistake #1: Incorrect references to this

Mistake #2: Thinking there is block-level scope

Mistake #3: Creating memory leaks

Mistake #4: Confusion about equality

Mistake #5: Inefficient DOM manipulation

Mistake #6: Incorrect use of function definitions inside for loops

Mistake #7: Failure to properly leverage prototypal inheritance

Mistake #8: Creating incorrect references to instance methods

Mistake #9: Providing a string as the first argument to setTimeout or setInterval

Mistake #10: Failure to use “strict mode”

Read more…

Happy Scripting:)