Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- string excludedStr(const string &str, const string &strx) // const string &str
- {
- setlocale(LC_ALL, "rus");
- string newStr = "";
- for (int i = 0; i < str.size(); i++)
- {
- int j = 0;
- while ((str[i] != strx[j]) && (j != strx.size()))
- ++j;
- if (j == strx.size())
- newStr += str[i];
- }
- return newStr;
- }
- char *excludedStr(const char str[], const char strx[])
- {
- setlocale(LC_ALL, "rus");
- int k = 0;
- char *newChar = new char[255];
- for (int i = 0; str[i] != '\0'; i++)
- {
- int j = 0;
- while ((str[i] != strx[j]) && (j != strlen(strx)))
- ++j;
- if (j == strlen(strx))
- {
- newChar[k] = str[i];
- k++;
- }
- }
- newChar[k] = '\0';
- return newChar;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement