summaryrefslogtreecommitdiff
path: root/theories/Strings/String.v
diff options
context:
space:
mode:
Diffstat (limited to 'theories/Strings/String.v')
-rw-r--r--theories/Strings/String.v22
1 files changed, 18 insertions, 4 deletions
diff --git a/theories/Strings/String.v b/theories/Strings/String.v
index 451b65cb..2be6618a 100644
--- a/theories/Strings/String.v
+++ b/theories/Strings/String.v
@@ -1,10 +1,12 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** Contributed by Laurent Théry (INRIA);
@@ -163,6 +165,18 @@ intros n0 H; apply Rec; simpl; auto.
apply Le.le_S_n; auto.
Qed.
+(** *** Concatenating lists of strings *)
+
+(** [concat sep sl] concatenates the list of strings [sl], inserting
+ the separator string [sep] between each. *)
+
+Fixpoint concat (sep : string) (ls : list string) :=
+ match ls with
+ | nil => EmptyString
+ | cons x nil => x
+ | cons x xs => x ++ sep ++ concat sep xs
+ end.
+
(** *** Test functions *)
(** Test if [s1] is a prefix of [s2] *)