PDA

View Full Version : How to avoid unnecessary chars in QStringList item?



crazymoonboy
12th August 2009, 22:04
Hi,

I am trying to delete ? characters from the below data and want to store the resultant output in a QStringList item.

QString receivedItem = "BOM ?
DEL:1.0 ?
VSP:UTF-8/ ?
HYD/ThisisTest ?
END:VBKM"

Can anybody help me how can I do this?

Thanks in advance.

Regards,
Chandra

wysota
12th August 2009, 22:46
What's wrong with using QString::remove() (the one that takes a QChar)?

faldzip
13th August 2009, 07:51
or maybe you want to use QString::split()? If you use it on your string like this:


QStringList list = receivedItem.split("?");

then the list contains 5 items: "BOM ", "DEL:1.0 ", "VSP:UTF-8/ ", "HYD/ThisisTest ", "END:VBKM"

nish
13th August 2009, 12:02
hey are you chandra moli?