diff samples/stringops.tp @ 152:a6739206a9e3

Add splitOn and partitionOn to string objects
author Mike Pavone <pavone@retrodev.com>
date Fri, 09 Aug 2013 20:12:04 -0700
parents 3e9cb69e516d
children 38140b7dbe3d
line wrap: on
line diff
--- a/samples/stringops.tp	Fri Aug 09 13:20:40 2013 -0700
+++ b/samples/stringops.tp	Fri Aug 09 20:12:04 2013 -0700
@@ -9,5 +9,13 @@
 
 		print: ("foobarbaz" from: 3) . "\n"
 		print: ("foobarbaz" from: 3 withLength: 3) . "\n"
+
+		foreach: ("foo,bar,baz,qux" splitOn: ",") :idx val {
+			print: val . "\n"
+		}
+
+		res <- "foobarbaz" partitionOn: "bar"
+		print: "Before: " . (res before) . "\n"
+		print: "After: " . (res after) . "\n"
 	}
 }