C# String Methods

About This Index
This page is the C# String Methods index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn what a string is on /c-sharp/string. Use this page when you need a specific API such as Contains(), Equals(), or Format().
Start with Contains(), Equals(), EndsWith(), and Format()—then browse the rest by category.
How to Call a String Method
Instance methods use a dot; static helpers use the class name:
string text = "Hello, C#!";
// Instance
bool hasCs = text.Contains("C#");
bool isCs = text.EndsWith("C#!");
bool same = text.Equals("Hello, C#!");
// Static
string joined = String.Concat("Hi", ", ", "C#");
string msg = String.Format("Count: {0}", 3); C# String Methods Table
All method guides in this C# tutorial series (15 tutorials).
Clone & copy
3 methodsDuplicate string content or copy characters into a char array.
Comparison & ordering
4 methodsEquality, culture rules, ordinal order, and IComparable results.
| Method | Description | Tutorial |
|---|---|---|
Compare() | Static culture-aware comparison. | Try it |
CompareOrdinal() | Static ordinal (code-point) order. | Try it |
CompareTo() | Instance IComparable comparison. | Try it |
Equals() | Content equality check. | Try it |
Search & match
2 methodsCheck whether text includes a substring or ends with a suffix.
| Method | Description | Tutorial |
|---|---|---|
Contains() | Substring present anywhere? | Try it |
EndsWith() | Suffix match at the end. | Try it |
Build & format
2 methodsJoin multiple strings and build formatted messages with placeholders.
Enumeration & metadata
4 methodsIterate characters, compute hash codes, and inspect runtime type information.
| Method | Description | Tutorial |
|---|---|---|
GetEnumerator() | foreach over characters. | Try it |
GetHashCode() | Hash code for collections. | Try it |
GetType() | Runtime Type of instance. | Try it |
GetTypeCode() | TypeCode enum for the value. | Try it |
Frequently Asked Questions
Start with Contains()
Open the first search method guide—syntax, examples, and FAQs.
15 people found this page helpful
