PDA

View Full Version : Qstring question!!



maybnxtseasn
18th March 2012, 03:27
Say i have a Qstring of the following

QString str1 = "HelloWorldThere";

How would i go about extracting the characters from index 2 all the way to index 7 within the string so i can effectively retrieve this sing.

Qstring extractedString = "lloWor";

Pretty much i just want to extract a string from within a string when i have a starting index and an ending index. Any help is greatly appreciated

mvuori
18th March 2012, 05:55
See QString class reference and mid() function.

Qstring extractedString = str1.mid(2, 6);