.NET LDAP client library for .NET Standard >= 2.0, .NET Core >=1.0, NET5/NET6/NET7/NET8 - works with any LDAP protocol compatible directory server (including Microsoft Active Directory).
I reworked Tokenizer, trying to remove the repeated splitting, as the elements were all already there and utilizing the built-in StringSplitOptions.RemoveEmptyEntries.
In doing this I found, that the current implementation would return a string twice, if it does not contain delimiters and the tokenizer is asked to return the delimiters. This is cause by Tokenize() not returning or setting tempstr to empty after if (tempstr.IndexOfAny(_delimiters.ToCharArray()) < 0 && tempstr.Length > 0), so that it is added again by the last if in that method.
I reworked Tokenizer, trying to remove the repeated splitting, as the elements were all already there and utilizing the built-in
StringSplitOptions.RemoveEmptyEntries
.In doing this I found, that the current implementation would return a string twice, if it does not contain delimiters and the tokenizer is asked to return the delimiters. This is cause by
Tokenize()
not returning or settingtempstr
to empty afterif (tempstr.IndexOfAny(_delimiters.ToCharArray()) < 0 && tempstr.Length > 0)
, so that it is added again by the lastif
in that method.