C# String Methods

Beginner
6 min read
Updated: Nov 2026
15 method guides
Method index

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().

Beginner path.

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:

C#
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 methods

Duplicate string content or copy characters into a char array.

MethodDescriptionTutorial
Clone()ICloneable; returns same string instance.Try it
Copy()Static: new string with same chars.Try it
CopyTo()Copy chars into a char array.Try it

Comparison & ordering

4 methods

Equality, culture rules, ordinal order, and IComparable results.

MethodDescriptionTutorial
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 methods

Check whether text includes a substring or ends with a suffix.

MethodDescriptionTutorial
Contains()Substring present anywhere?Try it
EndsWith()Suffix match at the end.Try it

Build & format

2 methods

Join multiple strings and build formatted messages with placeholders.

MethodDescriptionTutorial
Concat()Join two or more strings.Try it
Format()Composite-format templates.Try it

Enumeration & metadata

4 methods

Iterate characters, compute hash codes, and inspect runtime type information.

MethodDescriptionTutorial
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

String methods are built-in operations on System.String for comparing text, searching substrings, joining strings, formatting output, copying characters, and reading metadata. Call most of them on a string variable: text.Contains("C#").
The Strings page teaches what a string is—literals, interpolation, Length, and immutability. This Methods index lists every method tutorial so you can open Contains(), Equals(), Format(), and the rest.
Use dot notation on a string instance: str.Contains("test"), str.EndsWith(".cs"). Static helpers use String or string: String.Compare(a, b), String.Concat(parts), String.Format("{0}", value).
No. Methods like Concat() and Format() return new strings. For frequent edits in loops, use StringBuilder.
If you are new, read C# Strings first. Then open Contains(), Equals(), EndsWith(), and Format() from the table below.

Start with Contains()

Open the first search method guide—syntax, examples, and FAQs.

Contains() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

15 people found this page helpful