Commits

Anonymous committed 2a9b7da

+ Strings.Utf8.String.chop_prefix

  • Participants
  • Parent commits d4c8b11

Comments (0)

Files changed (1)

File src/cd_Strings.ml

               prefix_bytes ~string ~prefix = length_bytes prefix
             ;
 
+            value chop_prefix ~string ~prefix =
+              let pb = prefix_bytes ~string ~prefix in
+              if pb = length_bytes prefix
+              then S.sub string pb (String.length string - pb)
+              else string
+            ;
+
           end  (* Utf8.String *)
         ;