mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 08:46:13 +00:00
remove TerraScript ID keyword in favor of file name
This commit is contained in:
@@ -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