strange behaviour with `substr()` function



Hi,
today I noticed some another strange behaviour, that time with
`substr()` function.

*code* http://pastebin.com/X93pqd3z

the program get the text from an `entry` and store the text in a
`ustring` called `tags`. Then the code above cut in pieces by `;`. After
that, I have to remove all blank spaces.

So when I write in the entry `gtkmm; gtkmm`, `find_first_not_of(" ")`
and `last_not_of(" ")` return:

0 4

1 5

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.

regards,
Nicolas J.


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