mabeeh
13th May 2008, 20:32
I want to concatenate two strings together and have the text appear as one line. Not sure when this doesn't work. Please help. Thanks!
Code Example:
if (strCommands.at(i).startsWith("step number:",Qt::CaseInsensitive))
{
stepNumberText = strCommands.at(i).trimmed();
}
else
{
actionText = strCommands.at(i).trimmed();
uaTotal++;
}
lineText = stepNumberText.simplified() + " -- " + actionText.simplified()
std::cout << lineText.toStdString() << std::endl;
Output:
step number: 2 --
-- User Action: "Do Something"
step number: 3 --
-- User Verify: "Do Something else"
step number: 4 --
-- User Action: "Do this"
-- User Action: "do it again"
Code Example:
if (strCommands.at(i).startsWith("step number:",Qt::CaseInsensitive))
{
stepNumberText = strCommands.at(i).trimmed();
}
else
{
actionText = strCommands.at(i).trimmed();
uaTotal++;
}
lineText = stepNumberText.simplified() + " -- " + actionText.simplified()
std::cout << lineText.toStdString() << std::endl;
Output:
step number: 2 --
-- User Action: "Do Something"
step number: 3 --
-- User Verify: "Do Something else"
step number: 4 --
-- User Action: "Do this"
-- User Action: "do it again"