c# remove first character from string code example

Example 1: c# remove last character from string

string Name = "Teste,"
string ReturnName = "";
ReturnName = Name.Remove(Name.Length - 1);

Example 2: c# remove first 5 characters from string

str = str.Substring(n); //Where n is the number of characters you want to remove

Example 3: remove first character in a string c#

// initial string is "/temp" it will be changed to "temp"
data.Remove(0,1);
data.TrimStart('/');
data.Substring(1);

Example 4: c# remove first three characters from string

str = "hello world!";
str.Substring(n, str.Length-n)

Tags:

Java Example