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

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -