Print it:
string copyReplaceAll: 'you' with 'AA'
Literal strings are mutable by not in length so you can easily do destructive
changes in some special cases where you're sure that length doesn't
change. Thus the following is ok:
string replaceAll: $a with: $b
I think mutable literal strings are
On Sun, Dec 30, 2007 at 01:23:49PM +0100, an organic wrote:
> Hello,
>
> i am new to smalltalk and i look for some easy way to find some substring in
> another string and replace it by another substring:
>
> example: string := 'Hello how are you? I am fine. Thank you and you?'
> substring to find
Open up a method browser and search for:
findSubstring: in: startingAt: matchTable:
which is a method for ByteStrings and then look at
replaceFrom: to: with: startingAt:
I'm still new too so hope it works for you.
- Robert
On Sun, 2007-12-30 at 13:23 +0100, an organic wrote:
> Hello,
>
>
Hello,
i am new to smalltalk and i look for some easy way to find some substring in
another string and replace it by another substring:
example: string := 'Hello how are you? I am fine. Thank you and you?'
substring to find 'you' replace by 'AA'
transform to 'Hello how are AAA? I am fine. Thank