string的compare()函數,find()函數,

str1.compare(str2) 若是str1<str2,返回值小於0c++ 若是str1==str2,返回0函數 若是str1>str2,返回值大於0spa   find函數: str1.find(str2):在str1中查找是否存在str2子串,查找到則返回str2在str1中的起始序號位置,不然,能夠根據string::npos判斷code #include <bits/stdc++.h
相關文章
相關標籤/搜索