try
{
while( (strLine = (file.readLine()).trim() )!=null)
{
if ((strLine.length()) != 0)
{
FirstChar = strLine.charAt(0);
if ( (FirstChar != '\'') && (FirstChar != '#') && (FirstChar != '['))
{
strTmp = strTitle;
nIndex = strLine.indexOf(strTmp);
}
}
}
file.close();
}
catch(Exception e)
{
System.out.println(e.toString());
return null;
}
------解决方法--------------------------------------------------------
(strLine = (file.readLine()).trim()
如果strLine是null, null.trim()就报空指针异常了