📄 ldapnamesuffixprefix.java
字号:
import javax.naming.*;import javax.naming.ldap.*;/* * Retrieve's an LdapName's suffix and prefix */public class LdapNameSuffixPrefix { public static void main(String args[]) { String name = "cn=Mango, ou=Fruits, o=Food"; try { LdapName dn = new LdapName(name); Name suffix = dn.getSuffix(1); // 1 <= index < cn.size() Name prefix = dn.getPrefix(1); // 0 <= index < 1 System.out.println(suffix); System.out.println(prefix); } catch (InvalidNameException e) { System.out.println("Cannot parse name: " + name); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -