String Functions in C#



String Functions in C#

In this C#.net post, We will learn some string functions of C# with the help of example.
There are a lot of Predefined string functions are available in C# programming.
Let’s see some important string function with example.

List of C# String Function

String Functions Description
Compare() The C# Compare method compare two strings and returns integer value as output. It returns 0 for true and 1 and -1 for false.
Contains() The C# Contains method checks whether specified character or string is present inside a given string or not.
Equals() The C# Equals() method used to check if the given two strings are same or not. The Equals() method returns bool value true / false as output.
EndsWith() The C# EndsWith() string method check if the parameter string end with specified string. The EndsWith() returns bool value true / false in output.
StratsWith() The C# StartsWith() string method check if the parameter string start with specified string. The StartsWith() returns bool value true / false in output.
Length The C# String Length property used to get the length of string.
Replace() The C# Replace() method used to replace the character from given string. It returns a new string with replaced characters from original string.
Split() The C# Split method used to splits a string an array of given string based on the specified value.
SubString() The C# SubString() method is used to return a part of string from given string.
ToLower() The C# ToLower() string method used to convert string alphabets values to Lowercase alphabets values.
ToUpper() The C# ToUpper() string method used to convert string alphabets values to Uppercase alphabets values.
Trim() The C# Trim() method is used to remove extra whitespace from beginning and ending of string.

Subscribe us

If you liked this c#.net post, then please subscribe to our YouTube Channel for more c#.net video tutorials.

We hope that this C#.net tutorial helped you to understand All String Functions. We will learn all string functions one by one in our net c#.net tutorial.


Next asp.net c# tutorial we will learn about String Compare() Function.


Leave a Reply

Your email address will not be published. Required fields are marked *