minifiredragon
Programmer
I have been doing some looking around on ways to read certain characters of a CString into different variables and found substr();. But when I impliment it, I get an error:
C2039: 'substr' : is not a member of 'ATL::CStringT<BaseType,StringTraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
is there something I am doing wrong or can't it be used for a CString? Here is how I use it:
CString numtocheck = m_strcardcheck;
CString firstfour;
firstfour = m_strcardcheck.substr(0,4);
As you see I want the 1st four digits of the number entered. Some advice would be a great help, since you all have helped tremendously in the past.
Thanks!!
PS. I did search the forum here and found 2 threads on substrings but neither were of use.
C2039: 'substr' : is not a member of 'ATL::CStringT<BaseType,StringTraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
is there something I am doing wrong or can't it be used for a CString? Here is how I use it:
CString numtocheck = m_strcardcheck;
CString firstfour;
firstfour = m_strcardcheck.substr(0,4);
As you see I want the 1st four digits of the number entered. Some advice would be a great help, since you all have helped tremendously in the past.
Thanks!!
PS. I did search the forum here and found 2 threads on substrings but neither were of use.