Cuis-String escape

From Cuis CookBook
Revision as of 23:34, 3 May 2025 by Nmingott (talk | contribs) (imported material)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • The only special character in CuisSmalltalk strings is $'. This is quite unusual, Let's check for example \n means nothing to it.
'hello \n world'     "=> 'hello \n world' "
  • So, if you want to insert a $' inside a string you must just type it twice
'hey it''s me!' .    "=> 'hey it''s me!' "

Hey, you may say, the $' appears twice, that's not what i want! True, but let's what it is really inside the string looking at their characters we see how things really are:

'hey it''s me!' asArray . "=>  #($h $e $y $  $i $t $' $s $  $m $e $!) "