#include < iostream >
#include < string >
#include < sstream >
using namespace std;
vector< string> str_split(const string &s, char delim)
{
vector< string> elems;
stringstream ss(s);
string item;
while (getline(ss, item, delim)) {
elems.push_back(item);
}
return elems;
}
int main()
{
vector< string> str = str_split( "123,456", ',');
for(int i=0; i< str.size(); ++i)
{
printf("%s\n", str[i].c_str() );
}
}3/11/2014
C,C++, string split example source code (stringstream, getline functions)
Subscribe to:
Post Comments (Atom)
-
AMD GPU Programming Primer Threads · Waves · Memory · Tile Distribution · Vector Loads · MFMA ...
-
C · Preprocessor C forgets the name of every field the moment it finishes compiling. The X-macro is how a C programmer gets those...
-
C · Python · Linking Two acronyms one letter apart, describing promises made at two different moments. An API is what you agree t...
-
Contents What is a D-U-N-S Number? Prerequisites — Documents to Prepare Go to the D&B Application ...
-
This is data acquisition source code of LMS511(SICK co.) Source code is made by MFC(vs 2008). The sensor is communicated by TCP/IP. ...
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
Python · Language def append_to(item, target=[]) looks like it starts from an empty list every time. It does not. One list is cr...
-
ð FREE License Plate Recognition API - No Credit Card Required! Want to try ANPR (Automatic Number Plate Recognition) / ALPR (Automatic L...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
code 1 pip install imgaug . import os import cv2 import imgaug.augmenters as iaa def load_image ( image_path ): return cv2 .imrea...

No comments:
Post a Comment