|
-
October 17th, 1999, 01:30 AM
#1
How Do I Get Certain part of a string?
i am trying to get windows text in c++, i need to get the windows text and then extract certain part as my string such as: my name is raj, now here i need the part "raj" how do i do that in vc++?
-
October 17th, 1999, 01:45 AM
#2
Re: How Do I Get Certain part of a string?
If the text that you want to get is in a CString,
you just have to look in the (Class Member ) of the CString class
and you will find the function that you need or you can try
char buffer[4];
char name[] = "raj name";
int a;
for (a=0; a<3; a++)
{
buffer[a] = name[a];
}
I'm tired and i'm not sure if the best for this is for or while.
Serge Gagnon
-
October 17th, 1999, 02:06 AM
#3
Re: How Do I Get Certain part of a string?
Hi.
CSring as memer 2 functions thatyou can use for this case:
ine if CString::Find and the second is CString::GetAt(int Position);
the first will find some char inside this string.
the second will retrive the current char that place in this position.
HTH
kishk91
[email protected]
http://www.path.co.il
ICQ: 13610258
-
October 17th, 1999, 02:15 AM
#4
Re: How Do I Get Certain part of a string?
Use CString member functions Mid,Left and Right to extract part of a string.
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
|