Java中如何使用“点”分割字符串呢?

实现思路:

使用 字符串对象.split("\\.") 使用点分割字符串的示例分享
  

 package com.java265.other; public class test {
 /* * java265.com 点分割字符串的示例分享 */ 
public static void main(String[] args) throws Exception {
 String s = "java265.com"; String[] strList = s.split("\\.");
 for (String t : strList) { 
System.out.println(t); 
}
 } 
}
View Code

 

posted @ 2023-07-24 13:46  星空物语之韵  阅读(243)  评论(0)    收藏  举报