string s = "Hello, World!";
s.length() // 13
s[7] // 'W'
s.substr(7, 5) // "World" (position, count)
s.find("World") // 7
s.find("xyz") // string::npos
s.replace(7,5,"C++") // "Hello, C++!"
s += " More" // append
s + " Plus" // concatenate (creates new string)
#include <algorithm>
transform(s.begin(), s.end(), s.begin(), ::toupper); // "HELLO, WORLD!"
transform(s.begin(), s.end(), s.begin(), ::tolower); // "hello, world!"
Write isPalindrome(string s) that returns true if the string reads the same forwards and backwards, ignoring case.
Examples: "racecar" → true, "hello" → false, "Level" → true
Click "Run" to execute your code.