Answers for "c check if one string starts with another"

C
0

check if string starts with c

bool StartsWith(const char *a, const char *b)
{
   if(strncmp(a, b, strlen(b)) == 0) return 1;
   return 0;
}

...

if(StartsWith("http://stackoverflow.com", "http://")) { 
   // do something
}else {
  // do something else
}
Posted by: Guest on November-18-2020

Code answers related to "c check if one string starts with another"

Code answers related to "C"

Browse Popular Code Answers by Language