Click here to Skip to main content
15,898,134 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: std::string - HELP Pin
Roland Pibinger25-Jul-05 13:08
Roland Pibinger25-Jul-05 13:08 
GeneralRe: std::string - HELP Pin
Rob Caldecott26-Jul-05 21:08
Rob Caldecott26-Jul-05 21:08 
GeneralRe: std::string - HELP Pin
Kevin McFarlane30-Jul-05 23:38
Kevin McFarlane30-Jul-05 23:38 
GeneralRe: std::string - HELP Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX31-Jul-05 23:46
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX31-Jul-05 23:46 
GeneralRe: std::string - HELP Pin
Kevin McFarlane1-Aug-05 7:21
Kevin McFarlane1-Aug-05 7:21 
GeneralRe: std::string - HELP Pin
Nemanja Trifunovic1-Aug-05 8:12
Nemanja Trifunovic1-Aug-05 8:12 
GeneralRe: std::string - HELP Pin
Kevin McFarlane1-Aug-05 23:04
Kevin McFarlane1-Aug-05 23:04 
GeneralRe: std::string - HELP Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2-Aug-05 2:19
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2-Aug-05 2:19 
Kevin McFarlane wrote:
Actually it does handle '\t', as I've only specified a default argument.

Well, you require the user to define the white spaces for you? This is, at least, not user friendly (answer quickly, which chars are white space? Is '\n' a white space, is '\a'?). Hint: isspace.

Agreed, but still seems to work anyway.
An questionable answer for a professional software developer.

OK, how about this?

if (st1 != string::npos)
{
st2 = s.find_last_not_of(t) + 1;
s = s.substr(st1, st2 - st1);
}


substr() produces a (partial) copy which is assigned (= copied again) to s. You can do it all in place.
GeneralRe: std::string Pin
Igor Vigdorchik25-Jul-05 9:27
Igor Vigdorchik25-Jul-05 9:27 
Generalusing auto_ptr Pin
kramkrish21-Jul-05 1:17
kramkrish21-Jul-05 1:17 
GeneralRe: using auto_ptr Pin
Nish Nishant21-Jul-05 1:41
sitebuilderNish Nishant21-Jul-05 1:41 
GeneralRe: using auto_ptr Pin
Nish Nishant21-Jul-05 1:43
sitebuilderNish Nishant21-Jul-05 1:43 
GeneralRe: using auto_ptr Pin
kramkrish22-Jul-05 3:46
kramkrish22-Jul-05 3:46 
GeneralRe: using auto_ptr Pin
Jörgen Sigvardsson23-Jul-05 3:21
Jörgen Sigvardsson23-Jul-05 3:21 
GeneralRe: using auto_ptr Pin
Nish Nishant23-Jul-05 4:31
sitebuilderNish Nishant23-Jul-05 4:31 
GeneralBUG: ATL 7.0 fails if chunk size is 07ff (2047 bytes) Pin
arun140520-Jul-05 4:54
arun140520-Jul-05 4:54 
GeneralImporting foreign types in IDL File Pin
morenz19-Jul-05 6:49
morenz19-Jul-05 6:49 
GeneralRe: Importing foreign types in IDL File Pin
morenz20-Jul-05 0:54
morenz20-Jul-05 0:54 
GeneralPlz give me some advice about my code (IE Programming/ATL/COM/MFC) Pin
19-Jul-05 3:10
suss19-Jul-05 3:10 
GeneralRe: Plz give me some advice about my code (IE Programming/ATL/COM/MFC) Pin
Douglas Troy19-Jul-05 7:00
Douglas Troy19-Jul-05 7:00 
GeneralRe: Plz give me some advice about my code (IE Programming/ATL/COM/MFC) Pin
Member 212103819-Jul-05 17:25
Member 212103819-Jul-05 17:25 
GeneralATLSTR.H & SHOBJIDL.H not found Pin
TOMCAT8118-Jul-05 20:20
TOMCAT8118-Jul-05 20:20 
GeneralRe: ATLSTR.H & SHOBJIDL.H not found Pin
Douglas Troy19-Jul-05 6:43
Douglas Troy19-Jul-05 6:43 
GeneralRe: ATLSTR.H & SHOBJIDL.H not found Pin
TOMCAT8120-Jul-05 22:24
TOMCAT8120-Jul-05 22:24 
GeneralDuplicate Methos Name in ATL, please help I will rate yr answer Pin
LongIsland16-Jul-05 7:56
LongIsland16-Jul-05 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.