Skip navigation

This is actually really useful. I may actually set this up to be an extension method on system.string.


So, I didn’t EXACTLY check the code at the URL above to see if it was working…it’s not. And TECHNICALLY I need to convert hyphen delimited strings (such as an LDAP proper schema object name) to Hungarian Notation which is caml case with a leading lower case letter (for a proper ldapDisplayName value).

MY BAD. You caught me. You’re a better programmer than me. To qoute ‘Pretty Woman’:

“Very well, sir. You’re… not only handsome, but a powerful man. I could see the second you walked in here, you were someone to reckon with…”

private static string ConvertToLdapDisplayName(string p)
    string prefixThatShouldBeLowerCase = "";
p = p.Replace(prefixThatShouldBeLowerCase, prefixThatShouldBeLowerCase.ToLower());
string[] testArr = p.Split(new char[] { '-' });
StringBuilder sb = new StringBuilder();
foreach (string s in testArr)
if (s == prefixThatShouldBeLowerCase)
string camlCase = s[0].ToString() + s.Substring(1).ToLower();
return sb.ToString();

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: