|
-
March 23rd, 2007, 10:34 PM
#1
split string !!
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...
Last edited by enaz; March 23rd, 2007 at 10:36 PM.
Reason: for my final project
-
March 24th, 2007, 12:25 AM
#2
Re: split string !!
Use Mid function in CString class.
I think you should have a thorough understanding on CString and string.h functions
Dan
-
March 24th, 2007, 12:32 AM
#3
Re: split string !!
 Originally Posted by danandu
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.
- Sreehari
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
" Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin
-
March 24th, 2007, 01:03 AM
#4
Re: split string !!
-
March 24th, 2007, 01:10 AM
#5
Re: split string !!
it's it true?
string text = "school";
string fragment = text.substr (2, 4);.
-
March 24th, 2007, 02:41 AM
#6
Re: split string !!
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++
Dan
-
March 24th, 2007, 03:26 AM
#7
Re: split string !!
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..
Last edited by enaz; March 24th, 2007 at 03:32 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|