好的,所以我想做的是,在这个名为 Minecraft 的游戏中,如果他们输入 15h,则意味着 15 小时,或 20m,20 分钟。所以这就是我想出的。
String time = args[3];//args[3] is the text they write (15m, 1d, 20h)
time = time.replace("m", " minutes.");
time = time.replace("h", " hours.");
time = time.replace("d", " days.");
if(time.contains("m"))
{
//Convert the minutes into seconds
//In order to do that I have to pull out the number from "15m", so I would have to pull out 15, how would I do that?
}