2016-10-23 01:47:16 +00:00
|
|
|
#include<iostream>
|
|
|
|
#include<sstream>
|
2016-10-23 12:14:14 +00:00
|
|
|
#include<cstring>
|
2016-10-23 01:47:16 +00:00
|
|
|
#include"String.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
String str1;
|
|
|
|
std::stringstream stream;
|
|
|
|
stream << "sajt";
|
|
|
|
stream >> str1;
|
|
|
|
std::cout << str1 << std::endl;
|
|
|
|
String str2(" cicasajt");
|
|
|
|
String str3(str2);
|
|
|
|
str2 = str1;
|
|
|
|
String str4(String("sajtos cica"));
|
|
|
|
str2 = String(" tihihi");
|
|
|
|
std::cout << str4 + str3 << std::endl;
|
|
|
|
std::cout << ((str4 + str3)+=str2) << std::endl;
|
2016-10-23 12:14:14 +00:00
|
|
|
str4 += 'k';
|
|
|
|
std::cout << str4 << std::endl;
|
|
|
|
std::cout << str2+'k' << std::endl;
|
2016-10-23 01:47:16 +00:00
|
|
|
std::cout << str4[0] << static_cast<const String>(str2)[1] << std::endl;
|
2016-10-23 12:14:14 +00:00
|
|
|
String str5 = str2;
|
|
|
|
str5[0] = 'i';
|
|
|
|
std::cout << str5 << std::endl;
|
2016-10-23 01:47:16 +00:00
|
|
|
}
|