Skip to content

Instantly share code, notes, and snippets.

@feanz
Created January 9, 2015 16:01
Show Gist options
  • Save feanz/e6314454b264e364c0e3 to your computer and use it in GitHub Desktop.
Save feanz/e6314454b264e364c0e3 to your computer and use it in GitHub Desktop.
Remove character extensions (string Exntensions)
public static string RemoveLastCharacter(this string input)
{
return input.Substring(0, input.Length - 1);
}
public static string RemoveLast(this string instr, int number)
{
return input.Substring(0, input.Length - number);
}
public static string RemoveFirstCharacter(this string input)
{
return input.Substring(1);
}
public static string RemoveFirst(this string input, int number)
{
return input.Substring(number);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment