<HTML><HEAD><TITLE>Tcl Library Procedures - Tcl_Concat manual page</TITLE></HEAD><BODY> <H3><A NAME="M2">NAME</A></H3> Tcl_Concat - concatenate a collection of strings <H3><A NAME="M3">SYNOPSIS</A></H3> <B>#include <tcl.h></B><BR> char *<BR> <B>Tcl_Concat</B>(<I>argc, argv</I>)<BR> <H3><A NAME="M4">ARGUMENTS</A></H3> <DL> <P><DT>int <B>argc</B> (in)<DD> Number of strings. <P><DT>char <B>*argv[]</B> (in)<DD> Array of strings to concatenate. Must have <I>argc</I> entries. <P></DL> <H3><A NAME="M5">DESCRIPTION</A></H3> <B>Tcl_Concat</B> is a utility procedure used by several of the Tcl commands. Given a collection of strings, it concatenates them together into a single string, with the original strings separated by spaces. This procedure behaves differently than <B><A HREF="../TclLib/SplitList.htm">Tcl_Merge</A></B>, in that the arguments are simply concatenated: no effort is made to ensure proper list structure. However, in most common usage the arguments will all be proper lists themselves; if this is true, then the result will also have proper list structure. <P> <B>Tcl_Concat</B> eliminates leading and trailing white space as it copies strings from <B>argv</B> to the result. If an element of <B>argv</B> consists of nothing but white space, then that string is ignored entirely. This white-space removal was added to make the output of the <B><A HREF="../TclCmd/concat.htm">concat</A></B> command cleaner-looking. <P> The result string is dynamically allocated using <B><A HREF="../TclLib/Alloc.htm">Tcl_Alloc</A></B>; the caller must eventually release the space by calling <B><A HREF="../TclLib/Alloc.htm">Tcl_Free</A></B>. <H3><A NAME="M6">SEE ALSO</A></H3> <B>Tcl_ConcatObj</B> <H3><A NAME="M7">KEYWORDS</A></H3> <A href="../Keywords/C.htm#concatenate">concatenate</A>, <A href="../Keywords/S.htm#strings">strings</A> <HR><PRE> <A HREF="../copyright.htm">Copyright</A> © 1989-1993 The Regents of the University of California. <A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc. <A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE> </BODY></HTML>