Quantcast
Channel: How to split this string to obtain just the name value - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How to split this string to obtain just the name value

$
0
0

Hi I am looking for a simple way to et just the name after the CN value

CN=Andrew Adams,OU=Services,OU=Users,OU=GIE,OU=CSP,OU=STAFF,DC=example,DC=net

is there an easy way to do this? I am currently doing this:

ResultPropertyValueCollection manager = result.Properties["manager"];string managerUserName = manager[0].ToString();string[] managerNameParts = managerUserName.Split(',');string managerName = managerNameParts[0].Substring(4);Console.WriteLine("Manager Name:"+ managerName);

but it feels kind of bad.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles



Latest Images