Learn it from developers who built it.
Tutorials, how-tos and deep dives on AI, .NET, C#, cloud and developer tools, written by the community.
This code snippet shows how to pad strings in C# and .net core. Padding in the string is adding a space or other character at the beginning or end of a string. String class has String.PadLeft() and String.PadRight() methods to pad strings in left and right sides.

Code examples to add strings in C#, remove string in C#, and replace string 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#.

C# String Builder represented by the StringBuilder class in c# is used to concatenate strings in C# and provides string modifications methods including StringBuilder.Append(), StringBuilder.Remove(), and StringBuilder.Replace().

String.Trim(), String.TrimStart(), and String.TrimEnd() methods provide trim string functionality in C# and .NET. The Trim method removes white spaces from the beginning and endof a string. The TrimEnd method removes characters specified in an array of characters from the end of a string and TrimStart method removes characters specified in an array of characters from the beginning of a string.

Learn how to split a string in C#. A string can be splitted in C# separated by a character delimiter, string delimiter, and an array of characters.

In this article, you will learn how to replace a substring in a C# string.

Learn how to write code to generate random strings in C#.

Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

The differences between string and StringBuilder in .NET platform

This article is VB.NET version of Working with Strings in .NET using C#.

String manipulation is one of the favorite subjects of developers when learning C#. In this article, we are going to focus on string instance methods. We might not cover every method, but most of the common ones will be tackled.

How to use string Remove method to remove characters from a string at specified positions.

A C# string array is an array of strings. Here are different examples of implementing String Array in C#. C# String Array code examples.

In this article, we are going to cover String Interning - A very important feature of .NET Framework from the perspective of string comparison.

This article explains different ways to reverse a String in C#. Here we explored the possible ways using both Iterative and Recursive methodologies without using Reverse method of .NET framework.

Other than the regular string literals, C# supports what is called as Verbatim string literals.Verbatim string literals begin with @" and end with the matching quote. They do not have escape sequences.

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

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

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, two objects and one string and one object or more combination of these two.

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 you need a splash of colour or an enhancement to bring focus to something of importance.

This article shows various ways to find the occurrence of a string in another string, or how to find a substring in a string.

C# equivalent strnicmp function in C language. It accepts two input strings along with the number of positions of chars to compare.

In this article we will see the working of strings with combining characters (like diacritics in Arabic).

Learn how to use common C# System.String methods for case conversion, concatenation, copying, formatting, searching, inserting, and trimming text.

Learn how to implement custom C# string methods for proper case conversion, replacement, whitespace cleanup, character counting, reversing, substring extraction, and palindrome checks.

This article discusses how to format, trim and pad strings using the String class. The article also covers the StringBuilder to effectively deal with string such as string concatenation,

This article will show you a technique (new for C# 3.0) that allows you to extend the string class inside the .NET framwork to include your own string methods.
Everything on C# Strings, not only its articles: the C# Strings page →
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterMembers onlyWrite an article and earn +1,000 SHARP when it is approved.
Write an article