반응형
#include <iostream>
#include <sstream>
#include <string>
int main() {
std::string s = "1230456789"; // example string
std::stringstream ss(s); // create a stringstream with the string
std::string token;
while (getline(ss, token, '0')) { // split the string based on '0' character
std::cout << token << std::endl;
}
return 0;
}
c++ string 문자열 원하는 조건으로 문자열 나누기
가장 편한방법
반응형
'프로그래밍 _공부자료. > C++ 공부' 카테고리의 다른 글
std::signal 메개변수 뜻 (0) | 2023.07.25 |
---|---|
c++ static 사용이유 (0) | 2023.07.07 |
c++ 추상화 unorderMap 스마트포인터사용하기 (0) | 2023.02.13 |
C++ 클래스 Template 예제 5가지 (0) | 2023.02.12 |
리눅스 TCP/IP 클라이언트 기본 class 구조 . (0) | 2023.02.11 |
댓글