1、文件路径的分割:
String filePath="c:\\image\\product\\001.png";String[] aa=filePath.split(\\\\);
2、n 个空格分割:
String str = " To be or nor to be , that is question";
String str [] = str.split(" +");
本文详细介绍了如何使用Java语言进行文件路径的分割及文本中特定字符的多个空格分割,提供了实用的代码示例。
1、文件路径的分割:
String filePath="c:\\image\\product\\001.png";String[] aa=filePath.split(\\\\);
2、n 个空格分割:
String str = " To be or nor to be , that is question";
String str [] = str.split(" +");

被折叠的 条评论
为什么被折叠?