locked
Parse and split data table entity RRS feed

  • Question

  • User-718146471 posted

    Hello there. I am trying to figure out how in c# to take one table data entity which is an LDAP path for a user and then capture only the two first parts of the string. The string in the data table entity 1 looks like this:

    CN=Doe\, John,OU=ou1,OU=ou2,OU=ou3,OU=ou4,OU=ou5,OU=ou6,OU=ou7,DC=forest1,DC=domains,DC=myorg,DC=net

    What I want is only the parts Doe and John, the remainder can be dropped. Also, I need to remove the \ but I can do a replace to trim that off.

    Friday, June 30, 2017 4:32 PM

Answers

  • User-718146471 posted

    Already came up with a solution. I based it on setting a string value for each of the first two values, then dropped the remainder into a value called rest. Thereby leaving me with just the first and last names. Found the concept here:

    https://stackoverflow.com/a/6098485/621509 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 30, 2017 5:30 PM