I have a string an I would like to be able to take a substring from the middle of it. For example for the string 'abcdefg' I want to get 'cde' (but the exact start and stop could be arbitrary). I have found allButFirst:
and allButLast:
messages so I can do it in two steps like
str := 'abcdefg'
(str allButFirst: 2) allButLast: 2
But I was expecting there to be a single message. I also tried using from:to:
(which naively makes sense to me) but that doesn't work on the string class.
Is there a message in Pharo 9 Smalltalk that will take the start and stop or start and length for getting a substring?