60 std::string str(
"N->N2");
61 std::vector<std::string> str_split;
64 CPPUNIT_ASSERT_EQUAL(2,(
int)str_split.size());
65 CPPUNIT_ASSERT_EQUAL(str_split[0],std::string(
"N"));
66 CPPUNIT_ASSERT_EQUAL(str_split[1],std::string(
"N2"));
70 std::string str(
"N+C(s)->CN");
71 std::vector<std::string> str_split;
74 CPPUNIT_ASSERT_EQUAL(2,(
int)str_split.size());
75 CPPUNIT_ASSERT_EQUAL(str_split[0],std::string(
"N+C(s)"));
76 CPPUNIT_ASSERT_EQUAL(str_split[1],std::string(
"CN"));
80 std::string str(
"u:v:w:T:p:w_N:w_N2:p0");
81 std::vector<std::string> str_split;
84 CPPUNIT_ASSERT_EQUAL(8,(
int)str_split.size());
85 CPPUNIT_ASSERT_EQUAL(str_split[0],std::string(
"u"));
86 CPPUNIT_ASSERT_EQUAL(str_split[1],std::string(
"v"));
87 CPPUNIT_ASSERT_EQUAL(str_split[2],std::string(
"w"));
88 CPPUNIT_ASSERT_EQUAL(str_split[3],std::string(
"T"));
89 CPPUNIT_ASSERT_EQUAL(str_split[4],std::string(
"p"));
90 CPPUNIT_ASSERT_EQUAL(str_split[5],std::string(
"w_N"));
91 CPPUNIT_ASSERT_EQUAL(str_split[6],std::string(
"w_N2"));
92 CPPUNIT_ASSERT_EQUAL(str_split[7],std::string(
"p0"));
96 std::string str(
"u v w T p w_N w_N2 p0");
97 std::vector<std::string> str_split;
100 CPPUNIT_ASSERT_EQUAL(8,(
int)str_split.size());
101 CPPUNIT_ASSERT_EQUAL(str_split[0],std::string(
"u"));
102 CPPUNIT_ASSERT_EQUAL(str_split[1],std::string(
"v"));
103 CPPUNIT_ASSERT_EQUAL(str_split[2],std::string(
"w"));
104 CPPUNIT_ASSERT_EQUAL(str_split[3],std::string(
"T"));
105 CPPUNIT_ASSERT_EQUAL(str_split[4],std::string(
"p"));
106 CPPUNIT_ASSERT_EQUAL(str_split[5],std::string(
"w_N"));
107 CPPUNIT_ASSERT_EQUAL(str_split[6],std::string(
"w_N2"));
108 CPPUNIT_ASSERT_EQUAL(str_split[7],std::string(
"p0"));
112 std::string str(
"2.25853318e+03, -1.57454401e+00, 2.50363759e+00, -5.20253954e-06, ");
113 str +=
" 4.51647956e-09, -2.18115104e-12, 4.49430845e-16, 2.16895191e+05, 4.34577527e+00";
115 std::vector<std::string> str_split;
118 CPPUNIT_ASSERT_EQUAL(9,(
int)str_split.size());
119 CPPUNIT_ASSERT_EQUAL(str_split[0],std::string(
"2.25853318e+03"));
120 CPPUNIT_ASSERT_EQUAL(str_split[1],std::string(
"-1.57454401e+00"));
121 CPPUNIT_ASSERT_EQUAL(str_split[2],std::string(
"2.50363759e+00"));
122 CPPUNIT_ASSERT_EQUAL(str_split[3],std::string(
"-5.20253954e-06"));
123 CPPUNIT_ASSERT_EQUAL(str_split[4],std::string(
"4.51647956e-09"));
124 CPPUNIT_ASSERT_EQUAL(str_split[5],std::string(
"-2.18115104e-12"));
125 CPPUNIT_ASSERT_EQUAL(str_split[6],std::string(
"4.49430845e-16"));
126 CPPUNIT_ASSERT_EQUAL(str_split[7],std::string(
"2.16895191e+05"));
127 CPPUNIT_ASSERT_EQUAL(str_split[8],std::string(
"4.34577527e+00"));
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
All characters in delimiter will be treated as a delimiter.