有人能帮我吗?我对编程还很陌生,我决定尝试从 eclipse 来的 IDEA,但我遇到了一个问题,我从 eclipse 导入了一个可以工作的项目,但在 IDEA 中,我无法像在 eclipse 中那样引用我的 res 文件夹,就像我一样不能使用 res/image.png 我只能做 c:\ect。有谁知道为什么?我已将 res 文件夹设置为资源根目录。
我应该知道这个,但为什么这会openPos[1]
变为0?我知道它必须做与startPos[1] = 0
在findCloseCurlBracket()
方法,但为什么它做它没有意义.
int[] openPos = {1, 26};
System.out.println(openPos[0]+", "+openPos[1]);
int[] closePos = LuaTableParser.findCloseCurlBracket(stringList, openPos);
System.out.println(openPos[0]+", "+openPos[1]);
Run Code Online (Sandbox Code Playgroud)
findCloseCurlBracket()方法:
public static int[] findCloseCurlBracket(List<String> text, int[] openPos) {
int[] startPos = openPos;
int counter = 1;
for(int line = startPos[0]; line < text.size(); line++){
for(int index = startPos[1]; index < text.get(line).length()-startPos[1]; index++){
int[] curPos = {line, index};
if(getStringListCharAt(text, curPos) == '{'){
counter++;
}else if(getStringListCharAt(text, curPos) == '}'){
counter--;
}
if(counter == 0){
startPos[1] = 5;
return …
Run Code Online (Sandbox Code Playgroud)