# HG changeset patch # User Michael Pavone # Date 1406321016 25200 # Node ID 5d24b3117aa7a8700dd007c594a7adb95d50747b # Parent ea94b1e43c9720fc47b9fae4f1e8b57c0e19a56f Add startsWith? to string diff -r ea94b1e43c97 -r 5d24b3117aa7 modules/string.tp --- a/modules/string.tp Fri Jul 25 13:43:25 2014 -0700 +++ b/modules/string.tp Fri Jul 25 13:43:36 2014 -0700 @@ -303,6 +303,12 @@ } from: start withLength: (end - start) } + + startsWith? <- :prefix { + if: (prefix length) <= length { + 0 = (compareSub: prefix 0 0 (prefix length)) + } + } endsWith? <- :suffix { if: (suffix length) <= length {