+ 2
How to check if a word starts with "amend"
3 Answers
0
Java class String has method startsWith.
String t = "amendish";
boolean res = t.startsWith("amend");
// res is TRUE
0
can you help we with it in c++?
0
In C++ you can use strncmp
string t = "amendish";
string s = "amend";
int res = strncmp(t, s, strlen(s));
// res is 0
http://www.cplusplus.com/reference/cstring/strncmp