How to check if string starts with certain string in C?

后端 未结 5 1544
遥遥无期
遥遥无期 2021-01-04 03:42

For example, to validate the valid Url, I\'d like to do the following

char usUrl[MAX] = \"http://www.stackoverflow\"

if(usUrl[0] == \'h\'
   && usUr         


        
5条回答
  •  鱼传尺愫
    2021-01-04 03:58

    strstr(str1, "http://www.stackoverflow") is another function that can be used for this purpose.

提交回复
热议问题