I'm trying to extract the CN of an LDAP DN string.
Here's an example string that illustrates the problem
var dn = @"CN=Firstname Lastname\, Organization,OU=some ou,DC=company,DC=com";
What I want is the position of the first non escaped ',' character, which is at position 32.
var pos = dn.IndexOf(',');
returns the first comma, regardless of escaping or not. Now can I bring IndexOf
to skip the escaped comma in the string?