NStub.Core.Utility.GetUnqualifiedTypeName C# (CSharp) Méthode

GetUnqualifiedTypeName() public static méthode

Gets the unqualified name of the given type. For example, if System.IO.Stream is provided, Stream is returned.
name is null. name is an empty string.
public static GetUnqualifiedTypeName ( string name ) : string
name string The fully qualified name.
Résultat string
        public static string GetUnqualifiedTypeName(string name)
        {
            #region Validation

            if (name == null)
            {
                throw new ArgumentNullException("name", Exceptions.ParameterCannotBeNull);
            }
            if (name.Length == 0)
            {
                throw new ArgumentException(Exceptions.StringCannotBeEmpty, "name");
            }

            #endregion Validation

            return name.Substring((name.LastIndexOf('.') + 1),
                (name.Length - (name.LastIndexOf('.') + 1)));
        }