-1

如何从此字符串中拆分多个引号?请帮助我,我的项目因此卡在这里。

strLine1.trim().equalsIgnoreCase("Header Perceived Severity="":Friendly Name="":Alarm Type="":Specific Problems="":Event Date and Time="":Clearing Status="":Clearing Time="";");
4

1 回答 1

2

你的代码不会编译:

strLine1.trim().equalsIgnoreCase("Header Perceived Severity="":Friendly Name="":
    Alarm Type="":Specific Problems="":Event Date and Time="":
    Clearing Status="":Clearing Time="");
  1. 最后错过了右括号。
  2. 你需要转义引号
  3. 最后再加一句

.

strLine1.trim().equalsIgnoreCase("Header Perceived Severity=\"\":Friendly Name=\"\":
    Alarm Type=\"\":Specific Problems=\"\":Event Date and Time=\"\":
    Clearing Status=\"\":Clearing Time=\"\"");
于 2013-06-21T11:47:01.427 回答