mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-23 08:30:39 +00:00
remove TerraScript ID keyword in favor of file name
This commit is contained in:
1 parent
ab100c85a1
commit
18bc083431
8 files changed
+39
-45
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user