[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
sep = strpbrk(line, "\\<=->/'\"");
Open in new window
If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.
void TrimAndRemoveQuotes( char* pStr )
int nLen = strlen( pStr );
//Find 1st non-whitespace (currently only looks for spaces)
int nFirst = 0;
while( pStr[nFirst] == ' ' )
//Find Last non-whitespace (currently only looks for spaces
int nLast = nLen - 1;
if( nLast >= 0 )
while( pStr[nLast] == ' ' )
if( nLast < 0 )
//Test for Blank (or all white-space) string
if( nLast < 0 )
*pStr = 0;
//Check for matching quotes
if( nFirst < nLast )
if( pStr[nFirst] == pStr[nLast] )
char ch = pStr[nFirst];
if( ch == '\'' || ch == '\"' )
//Shift String in place
char* p = pStr;
for( int i = nFirst; i <= nLast; i++ )
*p = pStr[nFirst];
//Tack on EOS
*p = 0;
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.