如何通过优化比较 android 中的两个字符串?

How to Compare two strings in android with optimization?

我已经尝试使用 string.equal 函数来比较两个字符串,但优化方法是什么? 欢迎提出建议。

大家好,知道了,可能对其他人有帮助What's the quickest way to compare strings in Java? 感谢 Saurabh 分享 link.

根据我的说法,您应该使用字符串 class 的 equals() 方法来比较字符串。

if (xyz.equals("something")) { 
    //Do what you want if string is equal... 
}

看到这个also..