Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include "MyString.h" MyString::MyString(string s){ this->s = s; } void MyString::setS(string str){ this->s = str; } string MyString::getS(){ return s; } MyString MyString::removePunctuation(){ string result; remove_copy_if(s.begin(), s.end(), back_inserter(result), std::ptr_fun
(ispunct)); return MyString(result); } MyString MyString::toUpper(){ string temp = this->s; transform(temp.begin(), temp.end(), temp.begin(),::toupper); return MyString(temp); } MyString MyString::reverse(){ string temp = this->s; int n = temp.length(); for (int i = 0; i < n/2; i++) swap(temp[i], temp[n-i-1]); return MyString(temp); } MyString MyString::toMirror(){ string str = this->s; for(int i=0; i
s; int n = str.size(); bool palCheckTab[n][n]; for(int i = 0; i
maxLength) { start = i; maxLength = k; } } } } str = str.substr(start, maxLength); return MyString(str); } void MyString::checkStringType(){ map
M; for(int i=0; i
s; int n = str.size(); for(int i=0; i<=n/2; i++){ if(str[i] != str[n-i-1]){ palin = false; } if(str[n-i-1] != M[str[i]]){ mirror = false; } } if(palin && mirror){ cout << "Both" << endl; }else if(palin && !mirror){ cout << "Normal" << endl; }else if(!palin && mirror){ cout << "Mirror" << endl; }else{ cout << "Neither" << endl; } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)