C# string compare example

In this asp .net tutorial we will learn how to use c# string compare method with example and source code. C# string compare method is used to compare two strings, you have option to ingnore or compare case of the string.

C# string method returns a result that provides us information that string is greater than or less than the other, or that the two strings are equal.

Convert string to upper, lower and title case in asp .net

In this asp .net tutorial we will learn how to convert string into upper case, lower case and to title case.we will use inbuilt .net methods to convert the string to lower, upper and title case.

 

String Contains Example

 In this Asp .Net Tutorial we will learn who to use String.Contains method. String.Contains method is used to check whether a substring/text occurs within string or not.  This method uses case sensitive and culture-insensitive comparison to check substring with in a string. This method returns true if the substring is present in the string and returns false if the substring is not present in the string. 

String CompareTo Example to compare strings

  In this post we will see how to use String.CompareTo Method to match two strings. CompareTo Method returns following values:

  1. CompareTo Method returns. 
  2. Less than Zero.{when value of string with which we are compairing is greater than second value}. 
  3. Zero when strings match.
  4. Greater than Zero {when value of second string is greater than value with which we are compairing}.

String Concat Example

 In this article we will see how to use inbuilt String Concat method to join two different strings in code behind.

Step 1: Create two textboxes to receive input, one label to show concated result and Button.

 
 

About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice