For every character in string

Looping through the characters of a std::string, using a range-based for loop (it’s from C++11, already supported in recent releases of GCC, clang, and the VC11 beta): std::string str = ???; for(char& c : str) { do_things_with(c); } Looping through the characters of a std::string with iterators: std::string str = ???; for(std::string::iterator it = str.begin(); … Read more

Remove last character from string. Swift language

Swift 4.0 (also Swift 5.0) var str = “Hello, World” // “Hello, World” str.dropLast() // “Hello, Worl” (non-modifying) str // “Hello, World” String(str.dropLast()) // “Hello, Worl” str.remove(at: str.index(before: str.endIndex)) // “d” str // “Hello, Worl” (modifying) Swift 3.0 The APIs have gotten a bit more swifty, and as a result the Foundation extension has changed … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)