| strjoin |
(Array items [, String sep [, int undefined]]) |
yoix.string |
| |
Returns the string obtained by concatenating the elements in the
items
array and including
sep,
when it is supplied and not
NULL
(the default), between each pair of elements.
The result will be
NULL
if
items
is
NULL.
If an array item is not a
String,
it is converted to a
String
in the manner of
toString
before the join operation is performed.
By default, undefined elements in the
items
array are silently ignored, however if the optional
undefined
argument is non-zero then undefined elements are represented by the empty string (i.e.,
""),
which means the
sep
string will appear between every element in
items.
| |
| Example: |
The program,
import yoix.stdio.*;
import yoix.string.*;
String s1 = "abcdefghij";
String s2 = strjoin(strsplit(s1, ""), "\n ");
printf("s1=%s\ns2=%s\n", s1, s2);
prints
s1=abcdefghij
s2=a
b
c
d
e
f
g
h
i
j
on standard output.
| | |
| Return: |
String
| | |
| See Also: |
csvsplit,
linesplit,
strcasecmp,
strcat,
strchr,
strcmp,
strcpy,
strcspn,
strdel,
strdup,
strfmt,
strins,
strlen,
strncasecmp,
strncat,
strncmp,
strncpy,
strpbrk,
strrchr,
strrstr,
strsplit,
strspn,
strstr,
strtok
|
|
Yoix is a registered trademark of AT&T Inc.
|