Category: C#

How to Use Split Function in VB.NET?

The Split function in VB.NET (Visual Basic.NET) lets the developers to split the string based on the delimiter and return one – dimensional array that contains the substring. How to Use Split Function in VB.NET? Below is a sample code snippet that demonstrates how to use the Split function in VB.NET. Output of Split Function

C# Compiler Warning – CS8425 async-iterator ‘{0}’ has one or more par

In this blog post, you’ll learn more about the C# Compiler Warning – CS8425 and the related message description C# Compiler Warning Code CS8425 C# Compiler Description for the Code :CS8425 Async-iterator ‘{0}’ has one or more parameters of type ‘CancellationToken’ but none of them is decorated with the ‘EnumeratorCancellation’ attribute, so the cancellation token parameter from the generated ‘IAsyncEnumerable.GetAsyncEnumerator’ will be unconsumed

@ Operator in C#

Although it is not the best practise , If you want use the reserve words and the variable name , you could use the @ prefixed before the variable name . Below is a sample sourcecode that demonstrates the use of @ symbol. static void Main() { int @if = 10; MessageBox.Show(@if.ToString()); }

How to Print Leading Zeroes for a Number in C# ?

The Leading Zeroes for a number can be printed using the format string “D” in .NET . Below is a sample code snippet that demonstrates printing of 3 leading zeroes for a number 5 digit number in C#. How to Print Leading Zeroes for a Number in C# ?

Can i run Windows Phone 8.1 App on Windows Phone 8 device ?

If you are a developer who is developing Windows Phone 8.1 apps for the first time or if you are a beginner then you might have this question. Can i run Windows Phone 8.1 Project on Windows Phone 8 device ? If you develop a app targeting Windows Phone 8.0 , then this will run on Windows Phone 8.1 device but if you are developing…

C# Compiler Error – CS0281 friend access was granted by ‘{0}’, but

In this blog post, you’ll learn more about the C# Compiler Error – CS0281 and the related message description C# Compiler Error Code CS0281 C# Compiler Description for the Code :CS0281 Friend access was granted by ‘{0}’, but the public key of the output assembly (‘{1}’) does not match that specified by the InternalsVisibleTo attribute in the granting assembly.

Auto-Property Initializers for Read-Only Properties in C# 6.0

In the earlier version of C# , if you want a read-only property , you would end up having a backing field which is initialized in the constructor. In C# 6.0 , the auto-implemented properties can be used to implement read-only property using the auto-property initializer as shown below. Auto-Property Initializers for Read-Only Properties in C# 6.0