File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1171,6 +1171,12 @@ bool statusOk(int status)
1171
1171
}
1172
1172
1173
1173
1174
+ bool hasPrefix (const string & s, const string & suffix)
1175
+ {
1176
+ return s.compare (0 , suffix.size (), suffix) == 0 ;
1177
+ }
1178
+
1179
+
1174
1180
bool hasSuffix (const string & s, const string & suffix)
1175
1181
{
1176
1182
return s.size () >= suffix.size () && string (s, s.size () - suffix.size ()) == suffix;
Original file line number Diff line number Diff line change @@ -365,6 +365,10 @@ template<class N> bool string2Int(const string & s, N & n)
365
365
}
366
366
367
367
368
+ /* Return true iff `s' starts with `prefix'. */
369
+ bool hasPrefix (const string & s, const string & prefix);
370
+
371
+
368
372
/* Return true iff `s' ends in `suffix'. */
369
373
bool hasSuffix (const string & s, const string & suffix);
370
374
You can’t perform that action at this time.
0 commit comments