[Newbies] How to get a Newline Character

Michael Davies mykdavies at gmail.com
Mon Aug 18 15:01:37 UTC 2008


On Sun, Aug 17, 2008 at 2:41 PM, Felix Dorner <felix_do at web.de> wrote:
> Hi,
>
> I couldn't find anything about how to display special characters. It
> seems like there's no escape mechanism inside literal strings, such as
> (in java) "Hello \n World". Do I really have to represent this as:
> 'hello', String cr, 'world' ? I am aware that I can embed the newline
> in the with, uhm, a newline like this: 'Hello
> World'. I find this unsatisfactory, because often I am at a certain
> indent level and don't want to place such fragments at the beginning
> of a line.
>
In addition to #withCRs that Bert mentioned, there's also a set of
methods around #expandMacrosWithArguments: which also give tabs and
argument substitution eg:

'Hello <1s><n>Watch this<t><2p>' expandMacrosWithArguments: { 'Felix'. 'space'}.
gives
'Hello Felix
Watch this     "space"'

Cheers,
Michael


More information about the Beginners mailing list