Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイル名を文字列として読み込んでいます。これらのファイル名の長さはわかりませんが、すべて .txt で終わることはわかっています。ファイル名だけを残して .txt を削除したい。何か案は?
yourString.subtring(0, yourString.length()-4);
if(filepath.endsWith(".txt") { filepath = filepath.substring(0, filepath.lastIndexOf(".txt"); }