1 // vim: set et ts=4 sw=4:
9 string s1 = "base_translate";
10 string::size_type pos = s1.find(".");
11 if (pos == string::npos) {
12 cerr << "Dot not found in: " << s1 << endl;
14 s1 = "base.translate";
16 if (pos == string::npos) {
17 cerr << "Dot not found in: " << s1 << endl;
20 cerr << "Dot at position " << pos << " in: " << s1 << endl;
22 string s2(s1, 0, pos);
23 cout << "Module name: " << s2 << endl;
24 string s3 = s1.substr(pos + 1, s1.length() - 1);
25 cout << "Module name: " << s3 << endl;