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.
Thanks, Felix
Am 17.08.2008 um 14:41 schrieb Felix Dorner:
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.
'Hello\World' withCRs
- Bert -
On Sun, Aug 17, 2008 at 2:41 PM, Felix Dorner felix_do@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
beginners@lists.squeakfoundation.org