Files
freeCodeCamp/guide/russian/csharp/substring/index.md
2018-10-16 21:32:40 +05:30

25 lines
713 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Substring
localeTitle: Substring
---
# Substring
`Substring` извлекает часть строкового значения. Он используется с двумя целыми параметрами, первый - это местоположение первого символа (начинается с индекса 0), а второе - желаемой длины символа.
## пример
```
string firstSentence = "Apple, I have.";
string secondSentence = "I have a Pen.";
string apple = firstSentence.Substring(0,5);
string pen = secondSentence.Substring(9,3);
Console.WriteLine(apple);
Console.WriteLine(pen);
```
## Вывод:
```
>Apple
>Pen
```