This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

John McSweeney - picture detail

John McSweeney

July 24, 2008, 2:06 am

M206 Computing: An Object-oriented Approach

Appending a Character to a String

 

In SequenceableCollection you can find:

copyWith: newElement
  "Answer a copy of the receiver that is 1 bigger
  "than the receiver and has newElement at the last element."
    "code omitted"

An example of its use is:

|newString|
newString := 'Endin' copyWith: $g.
^newString "newString references 'Ending'"

« Back to FAQ page