Re: strange behaviour with `substr()` function




I see nothing wrong with that. Then if I use the `substr()` function, I
don't understand why I got, for the case (0,4): gtkm and for the case
(1.5) gtkmm.

substr() method internally creates a new Glib::ustring object using constructor [1] (actually, it's the same behavior as substr() from std::string [2]). So, substr(0, 4) means: get 4 characters from string, but start from index 0. Four first letters of "gtkmm" string are 'g', 't', 'k' and 'm'. 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]