on master help sign in
Merge pull request #1352 from Heather/string
f2e30f2Edwin Brady
libs/prelude/Prelude/Strings.idr+12
@@ -271,4 +271,16 @@ toUpper x with (strM x)
271 strToLower "" | StrNil = ""
271 strToLower "" | StrNil = ""
272 strToLower (strCons c cs) | (StrCons c cs) =
272 strToLower (strCons c cs) | (StrCons c cs) =
273 strCons (toUpper c) (toUpper (assert_smaller (strCons c cs) cs ))
273 strCons (toUpper c) (toUpper (assert_smaller (strCons c cs) cs ))
274+
275+--------------------------------------------------------------------------------
276+-- Predicates
277+--------------------------------------------------------------------------------
274
278
279+isPrefixOf : String -> String -> Bool
280+isPrefixOf a b = isPrefixOf (unpack a) (unpack b)
281+
282+isSuffixOf : String -> String -> Bool
283+isSuffixOf a b = isSuffixOf (unpack a) (unpack b)
284+
285+isInfixOf : String -> String -> Bool
286+isInfixOf a b = isInfixOf (unpack a) (unpack b)