csharp 删除字符扩展名(字符串Exntensions)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 删除字符扩展名(字符串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);
}

以上是关于csharp 删除字符扩展名(字符串Exntensions)的主要内容,如果未能解决你的问题,请参考以下文章