Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要实现一种从 FQDN 中提取主机名的方法。例如,如果假设的邮件服务器是mymail.somecollege.edu我想要得到的结果mymail 并且如果我得到非法字符串(不是真实的FQDN)不需要获取null或一些错误代码我如何提取主机名?-我不想解析我自己输入。而是寻找现有的API。谢谢我试图搜索第一个点'。- 在它是主机名之前的子字符串。但我正在寻找现有的 API
mymail.somecollege.edu
mymail
FQDN
null