// prace s retezcem
#include<iostream>
#include<sstream>
using namespace std;
int main(void){
  string a("auto");
  cout << a << " " << endl;
  string b("auto",2);
  cout << b << " " << endl;
  cout << endl;

  ostringstream str_out;
  string retezec;
  str_out << 1.34 << ' ' << " kg"; // zapis do bufferu
  retezec = str_out.str();    // vysledny retezec
  cout << retezec << endl;

  istringstream str_in;
  double x;
  str_in.str("5.37 metru");  // nastavi retezec
  str_in >> x >> retezec;   //  cteni z bufferu
  cout << x+1 << " " << retezec << endl;
  cout << endl;

  a = "leva";
  b = " ruka";
  string c;
  c = a ;                // kopirovani
  cout << c << endl;
  c = a + b;             // slouceni retezcu
  cout << c << endl;
  cout << (a == b) << endl;  // porovnani retezcu
  cout << endl;

  string text="tyden ma sedm dni";
  cout << text.length() << endl;      // delka retezce
  cout << text.find("sedm") << endl;  // hledani retezce
  cout << text.substr(2,11) << endl;  // vraci cast retezce
  cout << text.replace(9,8,"pet dni?") << endl; // nahrazeni
}

