Answers for "c++ print the last 20 character of string"

C++
1

c++ get last character of string

// Example
YourStr.substr(YourStr.length() - 1)

// Syntax
std::string YourStr = "abcdef";
std::cout << YourStr.substr(YourStr.length() - 1) << "n"; // OUTPUT: f
Posted by: Guest on May-05-2021

Code answers related to "c++ print the last 20 character of string"

Browse Popular Code Answers by Language