java - 从java中的字符串中提取mac地址
问题描述
这里的例子,
`String test = " 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
我知道这会解决你的问题!!!
推荐阅读
- javascript - 反应axios没有反应
- c# - 为什么我得到一个错误,我在 ping 上做错了什么?
- sql - 如何在 SQL Server Management Studio 中对 CASE 中的两行求和
- c++ - 需要知道如何通过读取 H265 视频将 Rtp 数据包发送到 vlc
- python - 正则表达式匹配 python 中格式为 {\...} 的所有字符串
- php - 更改节点集 xslt 中的字段
- javascript - echarts:通过动画响应
- javascript - 在以 html 上传之前对多个文件上传进行 javascript 验证
- docker - docker build 拉取基础镜像时出现 Docker 不安全的注册表问题
- vb.net - 如何格式化由总共 10 个加热组成的字符串结果,其中包含 0 和所需值