std::string contains

개발/C++

std::string contains 함수를 대신하는 find 함수

c++의 std::string에는 contains함수가 존재하지 않는다. 이를 대신하기 위해 find 함수가 존재한다. [function origin] size_t find (const string& str, size_t pos = 0) const; size_t find (const char* s, size_t pos = 0) const; size_t find (const char* s, size_t pos, size_t n) const; size_t find (char c, size_t pos = 0) const; [parameter] str : 찾고자 하는 문자열 pos : str을 pos위치부터 찾기 시작 s : 캐릭터형의 배열을 가리키는 포인터 n : 연속으로 일치해야 하는 최소 길이 c : 찾고..

njsung
'std::string contains' 태그의 글 목록