String a = "102.158.1 .2"
result b[] = a.split("\\.")
String a = "102.158.1 .2"
result b[] = a.split("\\.")
字符串拆分
将完整的字符串按照制定的内容拆分成字符串数组。对象数组string
String[] split(String regex)按照指定的字符串进行全部拆分 regex为空则每一个字符进行拆分
拆不开的用\\. 不加拆不开没有反应
正则标记拆不了
String[] split(String regex,int limit)
部分拆分,长度是由limit决定
课程内容版权均归魔乐科技MLDN所有 京ICP备09081638号-6
Powered by EduSoho v24.1.2 ©2014-2024