
String
https://cplusplus.com/reference/string/string/
char ch = 'F';
char res = ch - 'A' + 'a'; // ASC-II value returned char ch = 'f';
char res = ch - 'a' + 'A'; char ch = '1'; // 'a', 'A'....'z'
int ascii = ch;
cout<<ascii ;Q1: Reverse String
Q1: Reverse Stringvoid reverseString(vector<char>& s) {
reverse(s.begin(), s.end());
}bool isPalindrome(int x) {
string s = to_string(x);
string temp = to_string(x);
reverse(s.begin(), s.end());
if(s == temp)
return true;
else
return false;
}Q3: Valid Palindrome
Q3: Valid PalindromeQ5: Replace Spaces
Q5: Replace SpacesLast updated
