这为啥不 a.length() != a2.length() ????
不要拘泥与细节
可以,没问题。 这个是变量,直接调用性能没啥影响哈。 如果是 string.length(),超过几百次,编译器会对内联函数做运行时优化,也没问题。