Skip to content

Commit 66fa11b

Browse files
committed
Add notes about stripPrefix and stripSuffix
1 parent 84487d5 commit 66fa11b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Data/String/CodeUnits.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ foreign import splitAt :: Int -> String -> { before :: String, after :: String }
348348

349349
-- | Checks whether the given string starts with the pattern.
350350
-- |
351+
-- | **NOTE**: if you also want to get the string stripped of the pattern, see
352+
-- | `stripPrefix`.
353+
-- |
351354
-- | ```purescript
352355
-- | startsWith (Pattern "foo") "foobar" == true
353356
-- | startsWith (Pattern "bar") "foobar" == false
@@ -357,6 +360,9 @@ startsWith pat = isJust <<< stripPrefix pat
357360

358361
-- | Checks whether the given string ends with the pattern.
359362
-- |
363+
-- | **NOTE**: if you also want to get the string stripped of the pattern, see
364+
-- | `stripSuffix`.
365+
-- |
360366
-- | ```purescript
361367
-- | endsWith (Pattern "bar") "foobar" == true
362368
-- | endsWith (Pattern "foo") "foobar" == false

0 commit comments

Comments
 (0)