-1
即时通讯我的扫描仪读取我的文本文件与delemiter有问题。我试着去每个字符串保存在一个数组但是当我打印出来的阵列保持emty ... IDK为什么扫描仪和分隔符的问题
Scanner s = new Scanner(file);
s.useDelimiter("@");
int length = (upperBound - lowerBound)+1;
String [] Entries = new String[length];
for(int i=0; i < length; i++)
{
Entries[i] = s.next();
}
//When I print this the array location is empty:(
System.out.println(Entries[0]);
这是我的文本文件的内容:
The Germans occupy the rump Czech [email protected] invades Denmark and [email protected] Germany and its Axis partners invade the Soviet [email protected]
嗨!我无法帮助你,因为我不知道这是哪种编程语言。添加语言标签! –
我认为upperBound - lowerBound必须是非积极的 – ergonaut