# Substring()

*noun*

say it: **“SUB-string”** **/ˈsʌbstrɪŋ/**

A string method that returns part of a string, from a start position for a given number of characters.

## What is **Substring()** in C#?

**Substring()** — A string method that returns part of a string. You give the start index, and optionally how many characters to take; with no length, it takes everything to the end.

```csharp
string isbn = "978-0441172719";
Console.WriteLine(isbn.Substring(0, 3)); // 978
Console.WriteLine(isbn.Substring(4));    // 0441172719
```

## In a sentence

- “I took the first three digits of the ISBN with **Substring**(0, 3).”

Level: Apprentice · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=2)

Updated: October 28, 2026

## In other subjects

- [substring() in Java](https://www.ask-codey.com/glossary/substring)

Source: https://www.ask-codey.com/glossary/substring-c-sharp
