summaryrefslogtreecommitdiff
path: root/other/Kermit/test/test_string.cpp
blob: ad2de421423d80b9f020c6909e82195b3060e435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>
#include <algorithm>

main ()
{
  string a = "Hallo,bla: foo!";
  int x = 0;
  string b;

  cout << count (a.begin (), a.end (), 'l') << endl;
  x = a.find_first_of (",");
  b.resize (x + 1);
  a.copy (b.begin (), x);
  cout << b << endl;
  a.erase (0, x + 1);

  cout << b << endl;
  cout << a << endl;
}