• Skip to primary navigation
  • Skip to content
  • Skip to footer
🌈 코딩처음입니다만 🌈
  • CV
    박성창 (bigbigpark)

    박성창 (bigbigpark)

    Interested in Robotics SW

    • GitHub
    • 📂 Useful Code
      • - C++(28)
      • - Python(17)
      📂 Study
      • - 자료구조 (9)
      • - 알고리즘 (1)
      • - 코딩테스트 (10)
      • - 로보틱스 (1)
      📂 LIBRARY / FRAMEWORK
      • - ROS(16)
      • - ROS 2.0(3)
      • - Point Cloud Library(17)
      📂 Linux / Ubuntu
      • - 정리 자료(6)
      📂 Tips
      • - Trouble Shooting(14)
      • - Installation(25)
      • - Latex Syntax(1)

    문자열: 공백을 기준으로 자르기

    공백을 기준으로 문자열을 잘라보자

    
      #include <sstream>
      #include <vector>
      #include <string>
    
      int main()
      {
        string name = "alpha bravo charile delta";
        istringstream ss(name);
        
        vector<string> words;
        string word;
    
        while ( getline(ss, word, ' ') )
          words.push_back(word);
      }
    
    

    Tags: c++, cpp, string, 공백, 문자열자르기

    Categories: cpp_useful

    Updated: March 15, 2022

    이전 다음

    Leave a comment

    • Follow:
    • GitHub
    • Feed
    © 2024 bigbigpark. Powered by Jekyll & Minimal Mistakes.