annotate samples/stringops.tp @ 377:93c28eee141e tip

Merge
author Michael Pavone <pavone@retrodev.com>
date Sat, 15 Aug 2015 22:45:33 -0700
parents 056b8ad76559
children
rev   line source
pavone@43 1 #{
pavone@43 2 main <- {
pavone@43 3 print: "foo: " . 42 . "\n"
pavone@43 4 print: (string: (length: "foo" . "bar")) . "\n"
pavone@150 5 print: (string: ("foobarbaz" find: "foo" else: { "not found" })) . "\n"
pavone@150 6 print: (string: ("foobarbaz" find: "bar" else: { "not found" })) . "\n"
pavone@150 7 print: (string: ("foobarbaz" find: "baz" else: { "not found" })) . "\n"
pavone@150 8 print: (string: ("foobarbaz" find: "qux" else: { "not found" })) . "\n"
pavone@151 9
pavone@151 10 print: ("foobarbaz" from: 3) . "\n"
pavone@151 11 print: ("foobarbaz" from: 3 withLength: 3) . "\n"
pavone@152 12
pavone@152 13 foreach: ("foo,bar,baz,qux" splitOn: ",") :idx val {
pavone@152 14 print: val . "\n"
pavone@152 15 }
pavone@152 16
pavone@152 17 res <- "foobarbaz" partitionOn: "bar"
pavone@152 18 print: "Before: " . (res before) . "\n"
pavone@152 19 print: "After: " . (res after) . "\n"
pavone@158 20
pavone@158 21 print: (string: ("12abcDEF" parseHex32)) . "\n"
pavone@158 22 print: (string: ("FFFFFFFFFF" parseHex64)) . "\n"
pavone@259 23 print: "'" . (" \nfoobar baz " ltrim) . "'\n"
pavone@307 24 print: "'" . (" \nfoobar baz " trim) . "'\n"
pavone@307 25 print: "'" . (" \n\t\r" trim) . "'\n"
pavone@288 26 print: (72 utf8) . (101 utf8) . (108 utf8) . (108 utf8) . (111 utf8) . (0x1F604 utf8) . "\n"
pavone@43 27 }
pavone@43 28 }