From 3058e5f4192f8b9617ae157cb5d1e6040d79a8d9 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 2 Mar 2010 09:46:17 -0500 Subject: String.isPrefix --- lib/ur/string.ur | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/ur/string.ur') diff --git a/lib/ur/string.ur b/lib/ur/string.ur index 07d7e6b8..f19ce174 100644 --- a/lib/ur/string.ur +++ b/lib/ur/string.ur @@ -53,3 +53,6 @@ fun newlines [ctx] [[Body] ~ ctx] s : xml ([Body] ++ ctx) [] [] = case split s #"\n" of None => cdata s | Some (s1, s2) => {[s1]}
{newlines s2}
+ +fun isPrefix {Full = f, Prefix = p} = + length f >= length p && substring f {Start = 0, Len = length p} = p -- cgit v1.2.3