public static string GetDomainName(string fullUserName)
{
if (string.IsNullOrEmpty(fullUserName))
throw new ArgumentNullException("fullUserName");
int indexOfBackslash = fullUserName.IndexOf(@"/");
if (indexOfBackslash > 0)
return fullUserName.Substring(0, indexOfBackslash);
else
return string.Empty;
}
public static string GetUserName(string fullUserName)
{
if (string.IsNullOrEmpty(fullUserName))
throw new ArgumentNullException("fullUserName");
int indexOfBackslash = fullUserName.IndexOf(@"/");
if (indexOfBackslash > 0)
return fullUserName.Substring(indexOfBackslash + 1);
else
return fullUserName;
}