std::string find 함수 > IT Note

본문 바로가기
사이트 내 전체검색

IT Note

std::string find 함수
0

View 13,738  | 작성일2010.11.17 20:08

본문

bool IsTherePattern(const std::string source, const std::string pattern)
{
 // Source string 에 pattern 이 존재하는지 안하는지 boolean value를 리턴한다.
 if( source.find(pattern) != std::string::npos) 
  {
  // 존재하면 
  return true;
  }
  else
  {
  return false;
  }
}

// 주의!!.. 부분적으로 존재하면 무조건 true를 날림
// whole_word 단위 같은 계산은 없음

댓글목록

등록된 댓글이 없습니다.

IT Tip&Tech 목록

게시물 검색

접속자집계

오늘
996
어제
901
최대
6,399
전체
661,355
Copyright © LittleCandle All rights reserved.
문의메일 : littlecandle99@gmail.com
모바일 버전으로 보기