Lines Matching refs:str

31 string UpperStr(const string& str)
33 string upperString = str;
38 string LowerStr(const string& str)
40 string lowerString = str;
45 string ReplaceStr(const string& str, const string& src, const string& dst)
48 return str;
52 string strTmp = str;
61 string TrimStr(const string& str, const char cTrim /*= ' '*/)
63 if (str.size() == 1 && str[0] == cTrim) {
67 string strTmp = str;
95 void SplitStr(const string& str, const string& sep, vector<string>& strs, bool canEmpty, bool needTrim)
98 string strTmp = needTrim ? TrimStr(str) : str;
118 bool StrToInt(const string& str, int& value)
120 if (str.empty() || (!isdigit(str.front()) && (str.front() != '-'))) {
126 auto addr = str.c_str();
136 bool IsNumericStr(const string& str)
138 if (str.empty()) {
142 for (const auto& c : str) {
151 bool IsAlphaStr(const string& str)
153 if (str.empty()) {
157 for (const auto& c : str) {
166 bool IsUpperStr(const string& str)
168 if (str.empty()) {
172 for (const auto& c : str) {
181 bool IsLowerStr(const string& str)
183 if (str.empty()) {
187 for (const auto& c : str) {
196 bool IsSubStr(const string& str, const string& sub)
198 if (sub.empty() || str.empty()) {
202 return str.find(sub) != string::npos;
205 string::size_type GetFirstSubStrBetween(const string& str, const string& left,
208 string::size_type leftPos = str.find(left);
213 string::size_type rightPos = str.find(right, leftPos + left.length());
218 sub = str.substr((leftPos + left.length()), (rightPos - (leftPos + left.length())));
222 void GetSubStrBetween(const string& str, const string& left, const string& right, vector<string>& sub)
225 string strTmp = str;
246 bool IsAsciiString(const string& str)
248 size_t strLen = str.length();
250 if ((str[i] & 0x80) != 0) {
259 u16string Str8ToStr16(const string& str)
262 if (!String8ToString16(str, str16Value)) {