Quoting constructs: Difference between revisions

Content added Content deleted
Line 402: Line 402:


====Strings====
====Strings====
String literals are enclosed in single quotes. Conceptionally, they holde instances of Character as element, but actually the underlying storage representation is chosen to be space effective. Typically, underneath are classes like SingleByteString, TwoByteString and FourByteString, but this is transparent to the programmer. Strings can hold any Unicode character; UTF is only used when strings are exchanged with the external world.
String literals are enclosed in single quotes. Conceptionally, they holde instances of Character as element, but actually the underlying storage representation is chosen to be space effective. Typically, underneath are classes like SingleByteString, TwoByteString and FourByteString, but this is transparent to the programmer. Strings can hold any Unicode character; UTF8 is only used when strings are exchanged with the external world (which is good, as it makes operations like stringLength much easier).
<lang smalltalk>'hello'
<lang smalltalk>'hello'
'日本語 </lang>
'日本語 </lang>