- package com.popoaichuiniu.jacy;
-
- public class Test {
-
- public static void main(String[] args) {
- String fileName="xxxx.jpg";
- String fileNames []=fileName.split("\\.");
- System.out.println(fileNames.length);
- for(int i=0;i<fileNames.length;i++)
- {
- System.out.println(fileNames[i]+i);
- }
-
- }
-
- }
结果: 2 xxxx0 jpg1