Disco.Services.Interop.ActiveDirectory.ActiveDirectory.FriendlyAccountId C# (CSharp) Method

FriendlyAccountId() public static method

If the AccountId Domain matches the Primary Domain, returns the Account Username without the Domain specified
public static FriendlyAccountId ( string AccountId ) : string
AccountId string
return string
        public static string FriendlyAccountId(string AccountId)
        {
            var slashIndex = AccountId.IndexOf('\\');

            if (slashIndex > 0 && AccountId.Substring(0, slashIndex).Equals(ActiveDirectory.Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase))
                return AccountId.Substring(slashIndex + 1);
            else
                return AccountId;
        }