我们正在将应用程序从 .NET 转换为 Android
是否有 .NET Path.Combine() 函数的 Java 等效项?
目前我们在构建路径之前检查每个文件夹等上的/。
最佳答案
import java.io.File;
// ...
public static String pathCombine(String path1, String path2)
{
File parent = new File(path1);
File child = new File(parent, path2);
return child.getPath();
}
关于.net - Android 将 .NET Path.Combine 转换为 java?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3483982/