In this example, we’ll learn How to find the sum of two binary numbers. Here is source code of the C# Program to Find the Sum of two Binary Numbers. The C# program is successfully compiled and executed with Microsoft Visual...
Tag - C# Simple Examples
How to Search a C# List Elements?
In this tutorial, i’ll show you How to search C# List elements. The BinarySearch method of List<T> searches a sorted list and returns the zero-based index of the found item. The List<T> must be sorted before...
How to Reverse a C# List Elements?
The Reverse method of List<T> reverses the order all items in in the List. The following code snippet reverses a List. Example: C# static void Main(string[] args) { List<string> colors = new...
Find the Unique Combination of Sum From the Given Number in C#
In this tutorial i’ll show you How to find the unique combination of sum from the given number C#. Solution: Create an output list to store the valid sequences, create a current list that will store the current sequence...
as Operator in C# with Examples
In this tutorial,we’ll learn How to use ‘as’ operator in C#. The “as” operator perform conversions between compatible types. It is like a cast operation and it performs only reference conversions...
How to reverse a string with C# .NET
This is a straightforward and basic task to implement: given a string input to a function we want to return its reverse. There’s a wide range of solutions to this problem and here we’ll go through 3 of them using C#: the built...
How to Check Password Validity in C#
In this article, we will write a C# program to check password. While creating a password, you may have seen the validation requirements on a website like a password should be strong and have − Min 8 char and max 14 charOne lower...
How to Count the Number of Words in a String in C#
In this example we’ll learn How to count the number of words in a string in C#. Let us see the complete code to count a number of words in a string in C#. C# using System; public class Demo { public static void Main() { int...
How to Check if a Substring is Present in a Given String in C#
C# program to check if a Substring is present in a Given String. Use the contains() method in C# to check if a substring is in a given string. Let us say the string is − United 123 United Within the string, you need...
How to Add and Concatenate Strings in C# with Examples
In this example, i’ll show you How to add and concatenate string in C#. Plus Operator C# string str2 = "csharp" + str1; 123 string str2 = "csharp" + str1; Example Let us see an example of + operator to...