Horje
c++ string find last number Code Example
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
c++ string find last number
//Example
string str = "sdfsd34";

//Find the first first number and then all the number after
str.substr(str.find_first_of("0123456789"))

//Find the last number
size_t last_index = str.find_last_not_of("0123456789");
string result = str.substr(last_index + 1);
how to find last character of string in c++
String[strlen(String) - 1];




Cpp

Related
endl in c++ means Code Example endl in c++ means Code Example
c++ get data type Code Example c++ get data type Code Example
c++ logger class example Code Example c++ logger class example Code Example
file c++ Code Example file c++ Code Example
1 TO HUNDRED RANDOM NUMBER CPP Code Example 1 TO HUNDRED RANDOM NUMBER CPP Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11