how to check string start in C++

后端 未结 12 2047
Happy的楠姐
Happy的楠姐 2020-11-29 03:31

Is there any way in C++ to check whether a string starts with a certain string (smaller than the original) ? Just like we can do in Java

bigString.startswi         


        
12条回答
  •  没有蜡笔的小新
    2020-11-29 04:38

    http://www.cplusplus.com/reference/string/string/substr/

    You can use string.substr() to see any number of characters from any position, or you could use a string.find() member.

提交回复
热议问题