How to trim a String? 
Author Message
 How to trim a String?

hi,

i am new to C++?

how to trim a string or BSTR?

BSTR temp=SysAllocString(L"hi  ");
LPSTR temp2="  II  ";

thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 How to trim a String?

In MFC you can use Cstring::Trim

Quote:

> hi,

> i am new to C++?

> how to trim a string or BSTR?

> BSTR temp=SysAllocString(L"hi  ");
> LPSTR temp2="  II  ";

> thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 How to trim a String?
If you're going to do a lot of manipulations on a BSTR, it might actually be
easier to use an intermediate CString or std::basic_string to do the
manipulation,  and then put the result in a BSTR. CComBSTR and _bstr_t are
both missing quite a bit of functionality that you get in CString, and
CString's .AllocSysString() can be useful for getting the result when your
ready to convert to a BSTR.

Jeff


Quote:
> In MFC you can use Cstring::Trim




Quote:
> > hi,

> > i am new to C++?

> > how to trim a string or BSTR?

> > BSTR temp=SysAllocString(L"hi  ");
> > LPSTR temp2="  II  ";

> > thanks



Sat, 18 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to trim a string in a _variant_t

2. Is there any easier way to trim the string?

3. Help to trim spaces of a string

4. Trim a comma off end of string???

5. String.Trim();

6. String.Trim is this correct functionality

7. String.Trim() behavior

8. trim the string

9. Need help to trim spaces off a string

10. trimming a string

11. Right trim string function in C

12. trim for strings

 

 
Powered by phpBB® Forum Software