Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图比较 2 个 10,000 字节的字符串,这需要很多时间。有没有最快的比较方法?
请关闭它,问题不在于比较..我刚刚注意到它..
在 python 中比较两个字符串的最快方法总是:
if s1 == s2: print "strings are equal"
如果您有其他约束,则需要明确说明它们。