Re: [Pharo-users] Noob Question - slicing

2019-03-07 Thread Craig Johnson
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of K K Subbu Sent: Wednesday, 06 March 2019 16:45 To: pharo-users@lists.pharo.org Subject: Re: [Pharo-users] Noob Question - slicing > '1234567890' copyFrom: 5 to: 8 "5678" > > Page 207 in

Re: [Pharo-users] Noob Question - slicing

2019-03-06 Thread K K Subbu
On Wed, 6 Mar 2019 at 12:00, Craig Johnson > wrote: What is the simplest way to copy characters between positions 4 and 8 from a string in Pharo? '1234567890' copyFrom: 5 to: 8 "5678" Page 207 in Updated Pharo by Example book explains more on substrings.

Re: [Pharo-users] Noob Question - slicing

2019-03-06 Thread Sven Van Caekenberghe
In Calypso, select the checkbox next to the virtual category 'instance side', which will show all inherited methods (below Object) in the same browser, scroll to copy. #drop:take: sounds totally obscure to me, way worse than #copyFrom:to: first: or last: And what is your point with the Unicode

Re: [Pharo-users] Noob Question - slicing

2019-03-06 Thread Tim Mackinnon
Nice reply Richard - do you ever post any of these in a blog - the one below would be a great one to point to from Exercism... > On 6 Mar 2019, at 12:48, Richard O'Keefe wrote: > > As someone else already pointed out, the standard way to copy > part of any array-like sequence is >aSequence

Re: [Pharo-users] Noob Question - slicing

2019-03-06 Thread Richard O'Keefe
As someone else already pointed out, the standard way to copy part of any array-like sequence is aSequence copyFrom: firstIncludedIndex to: lastIncludedIndex How could you have found this by yourself? >From the background, either Click-select Tools-select Playground or hold Ctrl down while t

Re: [Pharo-users] Noob Question - slicing

2019-03-05 Thread Offray Vladimir Luna Cárdenas
On 5/3/19 17:59, Craig Johnson wrote: > > Hi All, > >   > > I was trying to figure an elegant way to slice strings (Python style), > and came up empty. > >   > > What is the simplest way to copy characters between positions 4 and 8 > from a string in Pharo? > >   > > Craig > You can use: 'String