Codes/Volume 01/E0042 Coded triangle numbers.cpp
//reads strings which have " around them and only one line of csv
reads strings which have " around them and only one line of csv
reads strings which have " around them and only one line of csv
vector<string> readNaiveStringCSV(string filePath){
    fstream file(filePath, fstream::in);
    string fullString;
    if(file.is_open()){
        if(file.good()){
            file>>fullString;
        }
        file.close();
    }
    vector<string> values = tokenizeWithChar(fullString, ',');
    for(string &name: values){
        name.erase(name.begin());
        name.erase(name.end()-1);
    }
    return values;
}
vector < string > readNaiveStringCSV ( string filePath ) { fstream file ( filePath , fstream :: in ) ; string fullString ; if ( file . is_open ( ) ) { if ( file . good ( ) ) { file >> fullString ; } file . close ( ) ; } vector < string > values = tokenizeWithChar ( fullString , ' ' ) ; for ( string & name : values ) { name . erase ( name . begin ( ) ) ; name . erase ( name . end ( ) - 1 ) ; } return values ; }
reads strings which have " around them and only one line of csv
reads strings which have " around them and only one line of csv