这里是例子,
`字符串测试 = "link/ether 00:0c:29:d1:86:4e brd ff:ff:ff:ff:ff:ff";
00:0c:29:d1:86:4e 是 Mac 地址。 我应该如何提取MacAddress并且MacAddress的位置不是静态的?
提前致谢!!
最佳答案
String test = " link/ether 00:0c:29:d1:86:4e brd ff:ff:ff:ff:ff:ff";
String[] tokenizeString = (test.trim()).split(" ");
System.out.println(tokenizeString[1]); //From question you are intrested on this stuff only
我认为这可以解决您的问题!!!
关于java - java中从字符串中提取mac地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54779760/