Cuis-String escape

From Cuis CookBook
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 $!) "