Answers for "c# right function"

C#
0

c# right function

/// <summary>Get substring of specified number of characters on the right.
	/// There is no built-in 'Right' function in C#</summary>
    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);
    }
Posted by: Guest on July-11-2021

C# Answers by Framework

Browse Popular Code Answers by Language