Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

split string by delimiter cpp

// C++ program to understand the use of getline() function
  
#include <bits/stdc++.h>
using namespace std;
  
int main()
{
    string S, T;
  
    getline(cin, S);
  
    stringstream X(S);
  
    while (getline(X, T, ' ')) {
        cout << T << endl;
    }
  
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #split #string #delimiter #cpp
ADD COMMENT
Topic
Name
8+9 =