Deep RTS
String.h
Go to the documentation of this file.
1//
2// Created by per on 1/11/21.
3//
4
5#ifndef DEEPRTS_STRING_H
6#define DEEPRTS_STRING_H
7#include <string>
8#include <vector>
9#include <cstring>
10#include <cstdio>
12
13
14public:
15 static std::vector<std::string> split(const std::string& str,const std::string& sep){
16 char* cstr=const_cast<char*>(str.c_str());
17 char* current;
18 std::vector<std::string> arr;
19 current=strtok(cstr,sep.c_str());
20 while(current!=NULL){
21 arr.emplace_back(current);
22 current=strtok(NULL,sep.c_str());
23 }
24 return arr;
25 }
26};
27
28#endif //DEEPRTS_STRING_H
Definition: String.h:11
static std::vector< std::string > split(const std::string &str, const std::string &sep)
Definition: String.h:15