gpt4 book ai didi

java - 如何在java中拆分字符串中的目录路径组件

转载 作者:搜寻专家 更新时间:2023-11-01 04:00:02 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
how to split the string in java

FileSystemView fsv = FileSystemView.getFileSystemView();
File[] roots = fsv.getRoots();
for (int i = 0; i < roots.length; i++)
{
System.out.println("Root: " + roots[i]);
}
System.out.println("Home directory: " + fsv.getHomeDirectory());

根目录:C:\Users\RS\Desktop主目录:C:\Users\RS\Desktop

我想削减根目录或主目录组件,例如字符串 C、用户、RS、桌面

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com