DevCode.Extensions/StringExtensions.cs
/// <summary>
/// Gets a substring of a string from end of the string.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="str"/> is null</exception>
/// <exception cref="ArgumentException">Thrown if <paramref name="len"/> is bigger that string's length</exception>
Gets a substring of a string from end of the string.
Gets a substring of a string from end of the string .
public static string Right(this string str, int len)
        {
            if (str == null)
            {
                throw new ArgumentNullException(nameof(str));
            }
            if (str.Length < len)
            {
                throw new ArgumentException("len argument can not be bigger than given string's length!");
            }
            return str.Substring(str.Length - len, len);
        }
public static string Right ( this string str , int len ) { if ( str == null ) { throw new ArgumentNullException ( nameof ( str ) ) ; } if ( str . Length < len ) { throw new ArgumentException ( " " ) ; } return str . Substring ( str . Length - len , len ) ; }
Gets a substring of a string from end of the string.
Gets a substring of a string from end of the string .
Thrown if  is null
Thrown if is null
Thrown if  is bigger that string's length
Thrown if is bigger that string ' s length
string
this
len
int