#How to slice string with start and end not start and count?
8 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
to clarify it more, let say I have this string hello
I want to get ell substring so I do s.substr(1, 3) but instead I got ello (i didn't test it, it probably would return other result but still its not what I want)
Yes I can do s.substr(1,2) to get ell but let say I don't know the count but I know the end index.
Ok I think I know how to solve this
I can do end - start to get the count. The code would like this:
s.substr(start, end - start)
!solved
Thank you and let us know if you have any more questions!
!close