ldap search attribut result "cn=Klaus", I want this only "Klaus"

Hello,

of course i could remove the position 0-2 from the String "cn=Klaus" to get a substring like "Klaus" but i don`t wanna use an extra "for loop" if there maybe exists another possibility to get a clean output like "Klaus"

someone knows an ldap method to get ONLY the pure value of the cn attribute?

[322 byte] By [4tha] at [2007-11-15]
# 1

Looks like you're looking at the Context name and not the CN attribute itself.

When doing a read or a search, you can specify one or more attributes to be returned. The attribute will contain its values "clean".

<http://java.sun.com/products/jndi/tutorial/ldap/search/result.html#ATTRS>

Regards,

Ludovic.

ludovicpa at 2007-7-28 > top of java,Core,Core APIs...
# 2

A picture says more then 1000 words ;-)

http://666kb.com/i/aq0uxeznt366h8z2b.jpg

check out my both JList filled with return attribut "cn"

The full string always has the "cn:" included which i have to remove with the following code:

String realCN = attrb.toString().substring(4);

well this line of code doesnt matter much but well its additional work :D

4tha at 2007-7-28 > top of java,Core,Core APIs...