add split string to vector int
This commit is contained in:
@@ -45,9 +45,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
{// ex: string::split_str
|
||||
std::string str { "asdf,qwer,zxcv" };
|
||||
std::string str_int { "1 2 3" };
|
||||
hack::string::v_str v = hack::string::split_str(str, ',');
|
||||
auto v_int = hack::string::split_stoi(str_int, ' ');
|
||||
hack::log log;
|
||||
for (const auto& c : v) log(c);
|
||||
for (const auto& c : v_int) log(c);
|
||||
|
||||
std::string str_2 { "qqq,aaa:eee,ggg" };
|
||||
hack::string::v_str v_2 = hack::string::split_str(str_2, ",:");
|
||||
|
||||
Reference in New Issue
Block a user