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

c# - Farseer ContactListener is not working -

Automatically create pages in phpfox -

database - one php page with different contents and urls -