User Tools

Site Tools


root:strings

This is an old revision of the document!


String manipulation

Substring

Get substring of existing string

TString new = old(start, subStrLength);
// start is the index of the first character
// subStrLength is the number of characters to copy
 
// e.g: remove S charachters form start and E from end
TString histName = filename(S, filename.Length()-S-E);

Text with variables

Combine some variables with a static Text

TString string = Form("My Number is %d", number);

If your variable is a TString, you need to convert it first

TString string = Form("My TString is %s", (char*) tstring);

The function follows printf-syntax

root/strings.1289381942.txt.gz · Last modified: 2010/11/10 10:39 by nchiap