plez...anybody can solve my problem?
how to split a string into smaller pieces in c++ programming... like a string "school" .. i want to split this string to be "hool" only...
Printable View
plez...anybody can solve my problem?
how to split a string into smaller pieces in c++ programming... like a string "school" .. i want to split this string to be "hool" only...
Use Mid function in CString class.
I think you should have a thorough understanding on CString and string.h functions
not necessary, if he does not intend to use CStrings of Strings.Quote:
Originally Posted by danandu
so, how can i do?
it's it true?
string text = "school";
string fragment = text.substr (2, 4);.
The Standard C++ library provides two specializations of this template class, with the type definitions string, for elements of type char, and wstring, for elements of type wchar_t.
Pl read the msdn on string in c++:)
i got it!!
main() {
string text = "i got it!!";
string fragment = text.substr (6,4);
cout<< text << "= ";
cout<< fragment <<endl; ;
return 0;
}
output ;
i got it!!= it!!
thanks for everybody..