I would like to use substr() function in order to get the chain of characters from the 1. to the last, without 0.
Should I do sth like this:
string str = xyz.substr(1, xyz.length());
or (xyz.length() - 1) ? And why?
void
main()
{
std::string str1 = "abracadabra";
std::string str2 = "AbRaCaDaBra";
if (!str1.compare(str2)) {
cout << "Compares"
}
}
How can I make this work? Bascially make the above case insensitive. Related question
I Googled and here
http://msdn.microsoft.com/…
What is the easiest way to convert from int to equivalent string in C++. I am aware of two methods. Is there any easier way?
(1)
int a = 10;
char *intStr = itoa(a);
string str = string(intStr);
(2)
int a = 10;
stringstream ss;
ss &…
I'm trying to iterate over the words of a string.
The string can be assumed to be composed of words separated by whitespace.
Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, …