📜  c# right 函数 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:22.800000             🧑  作者: Mango

代码示例1
/// Get substring of specified number of characters on the right.
    /// There is no built-in 'Right' function in C#
    public static string Right(this string value, int length)
    {
        if (String.IsNullOrEmpty(value)) return string.Empty;
        return value.Length <= length ? value : value.Substring(value.Length - length);
    }