String in C#
Welcome to the String & StringBuilder section of C# Corner. In this section, you will find strings and string builder related articels, tutorials, source code samples, and discussions.


  • Mahesh Chand

    6 Effective Ways To Concatenate Strings In C# and .NET Core

    Adding strings is a common operation in C# and .NET. The String class provides several ways to add, insert, and merge strings including + operator, String.Concate(), String.Join(), String.Format(),...
    Mahesh Chand Oct 15, 2018
  • Mahesh Chand

    String Compare In C#

    The code examples compare strings in C# using String.Equals, String.Compare, String.CompareTo() method, and StringComparer. String compare in .NET and C# .
    Mahesh Chand Sep 24, 2018
  • Mahesh Chand

    Split String In C#

    The code examples in this tutorial demonstrates how to Split Strings in C#. Code examples for Splitting Strings use String.Split() method to separate strings based on character delimiter, string de...
    Mahesh Chand Sep 23, 2018
  • Mahesh Chand

    Uppercase and Lowercase Strings in C#

    C# String has ToUpper() and ToLower() methods to convert a string to uppercase and lowercase. This sample code demonstrates how to convert a string into lowercase string or uppercase string in C#.
    Mahesh Chand Sep 19, 2018
  • Kailash Chandra Behera

    Differences Between Text, Stream, String and Binary Data

    This article provides an overview of the differences between Text, Stream, String and Binary Data and related classes to stream.
  • Kailash Chandra Behera

    Finding Directories With Regular Expressions

    This article provides an example of using a regular expression to search a directory and determine a file type. C# Regular Expressions
  • Kailash Chandra Behera

    Checking Birthday By Regular Expression

    This example tries to check birthday using Regular Expression
  • Mahesh Chand

    Add, Remove, Replace Strings in C#

    This code snippet shows how to add, remove and replace strings in C# and .net core. Insert method in C#, Remove method in C#, Replace method in C#, Split method in C#.
    Mahesh Chand Sep 18, 2018
  • Mahesh Chand

    Format String in C#

    This code snippet shows how to format strings in C# and .net core. You can use the Format method to create formatted strings and concatenate multiple strings representing multiple objects. The Form...
    Mahesh Chand Sep 18, 2018
  • Mahesh Chand

    Padding Strings in C#

    This code snippet shows how to pad strings in C# and .net core.
    Mahesh Chand Sep 18, 2018
  • Puran Mehra

    StringBuilder C#

    In this article, I will explain you about the StringBuilder Class in C# and .net core. Both String and StringBuilder contain Unicode characters of type Char and support an indexer that returns Char...
    Puran Mehra Sep 18, 2018
  • Mahesh Chand

    Trim String in C#

    This code snippet shows how to trim a string in C# and .net core. The String class provides Trim, TrimStart and TrimEnd methods to trim strings. The Trim method removes white spaces from the beginn...
    Mahesh Chand Sep 18, 2018
  • Suthish Nair

    Convert A String To Title Case In C#

    There is no direct method like ToUpper(), ToLower() for Title Case. But using CultureInfo and TextInfo classes we can do Title case of a string.
    Suthish Nair Sep 18, 2018
  • Mahesh Chand

    Copy And Concatenate String In C#

    This code snippet shows how to copy and concatenate strings in C# and .net core. The Concat method adds strings (or objects) and returns a new string. Using Concat method, you can add two strings, ...
    Mahesh Chand Sep 18, 2018
  • Mahesh Chand

    StringCollection in C#

    StringCollection class is a new addition to the .NET Framework class library that represents a collection of strings. In this article, we will discuss how to take advantages of its methods and prop...
    Mahesh Chand Sep 18, 2018
  • Mahesh Chand

    7 Way to Use the C# SubString Method (Examples)

    A substring in C# is a contiguous sequence of characters within a string. This article and code examples demonstrate how to retrieve a C# Substring using String.Substring method using C# and .NET C...
    Mahesh Chand Sep 17, 2018
  • Mahesh Chand

    Generate Random Number And Random String In C#

    We can use the Random class and its methods to generate random integer in C# and .NET. The code snippet in this article how to generate random string and random int in C#.
    Mahesh Chand Sep 16, 2018
  • Mahesh Chand

    How To Convert A Byte Array To A String In C#

    This code snippet is example of how to convert a byte array to a string using C# and .NET Core and convert a string to a byte array.
    Mahesh Chand Sep 15, 2018
  • Mahesh Chand

    Select Random String From An Array In .NET Core and C#

    This article demonstrates how to pick a random string an array of strings.
    Mahesh Chand Sep 10, 2018
  • Eddie Gahan

    Enhancing Console Output With Underlining, Colors And More

    With the rise of .Net Core, GUI-less Console applications have come back into popular usage which is perfectly fine. It’s just that they’re so bland; black and white and basic text when sometimes ...
    Eddie Gahan Jul 26, 2018
  • Arjun Singh

    Split Line Based on Given Set of Sub Strings

    In this blog you will learn how to split the line based upon a given set of sub strings which is available in the line.
    Arjun Singh Jun 29, 2016
  • Mahesh Chand

    String in C#

    In this article, you will learn how to work with strings in C#. The article discusses the String class, its methods and properties and how to use them.
    Mahesh Chand May 05, 2016
  • Kailash Chandra Behera

    Regular Expression Character Classes

    List of characters used by Regular Expression.
  • Kailash Chandra Behera

    Quantifiers used in Regular Expressions.

    This blog lists quantifiers used in Regular Expression
  • gary sun

    strnicmp equivalent in C#

    C# equivalent strnicmp function in C language. It accepts two input strings along with the number of positions of chars to compare.
    gary sun May 30, 2012