Join an array of C strings using the specified separator (also a C string). * Returns the result as an sds string. */
| 1134 | /* Join an array of C strings using the specified separator (also a C string). |
| 1135 | * Returns the result as an sds string. */ |
| 1136 | sds sdsjoin(char **argv, int argc, char *sep) { |
| 1137 | sds join = sdsempty(); |
| 1138 | int j; |
| 1139 | |
| 1140 | for (j = 0; j < argc; j++) { |
| 1141 | join = sdscat(join, argv[j]); |
| 1142 | if (j != argc-1) join = sdscat(join,sep); |
| 1143 | } |
| 1144 | return join; |
| 1145 | } |
| 1146 | |
| 1147 | /* Like sdsjoin, but joins an array of SDS strings. */ |
| 1148 | sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) { |
no test coverage detected