Question about String

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about String

Fabrizio Perin-3
Hi,
evaluating the following code:

('Fred', String cr , 'the' , String cr , 'Bear') lineCount

('Fred', String cr , 'the' , String cr , 'Bear', String cr) lineCount 


I got the same answer that is 3 but the second string doesn't have 4 lines?

Regards,

Fabrizio


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Question about String

niko.schwarz
Depends on who you ask. Your standard Windows developer will say it's
4, your standard Unix believer will say it's 3 (because in Unix text
files always end in a newline. And String cr is used roughly like Unix
\n, although it's another character.)

Niko

2010/6/9 Fabrizio Perin <[hidden email]>:

> Hi,
> evaluating the following code:
> ('Fred', String cr , 'the' , String cr , 'Bear') lineCount
> ('Fred', String cr , 'the' , String cr , 'Bear', String cr) lineCount
>
> I got the same answer that is 3 but the second string doesn't have 4 lines?
> Regards,
> Fabrizio
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
http://scg.unibe.ch/staff/Schwarz
twitter.com/nes1983
Tel: +41 076 235 8683

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project