remove TerraScript ID keyword in favor of file name

This commit is contained in:
dfsek
2021-10-17 11:16:24 -07:00
parent ab100c85a1
commit 18bc083431
8 changed files with 39 additions and 45 deletions

View File

@@ -0,0 +1,16 @@
package com.dfsek.terra.api.util;
import java.io.File;
public class StringUtil {
public static String fileName(String path) {
if(path.contains(File.separator)) {
return path.substring(path.lastIndexOf(File.separatorChar) + 1, path.lastIndexOf('.'));
} else if(path.contains(".")) {
return path.substring(0, path.lastIndexOf('.'));
} else {
return path;
}
}
}