Java 详细信息格式化程序错误:求值必须包含表达式或格式良好的语句块
我在调试模式下遇到以下错误: 详细信息格式化程序错误: 计算必须包含表达式或格式良好的语句块 代码示例:Java 详细信息格式化程序错误:求值必须包含表达式或格式良好的语句块,java,eclipse,text-files,Java,Eclipse,Text Files,我在调试模式下遇到以下错误: 详细信息格式化程序错误: 计算必须包含表达式或格式良好的语句块 代码示例: try { content = new String(Files.readAllBytes(Paths.get(inputFile))); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } Str
try {
content = new String(Files.readAllBytes(Paths.get(inputFile)));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String[] parts = content.split("."); //Here I get the above error
我做错什么了吗?解决方案:
String[] parts = content.split("\\.");
奇怪的content.split(“.”)是有效的表达式。我不知道你为什么会犯这样的错误。你清理你的项目了吗?