Languages
[Edit]
EN

C# / .NET - remove first character from string

0 points
Created by:
Trenton-McKinney
618

In this article, we would like to show you how to remove the first character from the string in C# / .NET.

 

1. Using String substring() method

Edit

In the example below, we use the String Substring(int beginIndex) method, where we assign 1 to beginIndex, so we get a string without the first character.

Output:

2. Using range operator ..

Edit

The range operator .. is used to make a slice of the collection.

Output:

Reference

Edit
  1. Substring() method - .NET Docs
  2. Range operator - .NET Docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

C# / .NET - String (popular problems)

C# / .NET - remove first character from string
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join