c++ - How to convert QString to int? -


i have qstring in sources. need convert integer without "kb".

i tried abcd.toint() not work.

qstring abcd = "123.5 kb" 

you don't have digit characters in string. have split space

qstring abcd = "123.5 kb"; abcd.split(" ")[0].toint();    //convert first part int abcd.split(" ")[0].todouble(); //convert first part double abcd.split(" ")[0].tofloat();  //convert first part float 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -