Skip to main content

Join Strings with Delimiter

JUNIOR

Join Strings with Delimiter

Join array of strings with a custom delimiter.

Requirements:

  • Join all strings with delimiter
  • Handle empty arrays
  • Handle empty strings in array

Example:

Input: ["hello", "world"], delimiter = "-"
Output: "hello-world"

Input: ["a", "b", "c"], delimiter = ", "
Output: "a, b, c"

Examples:

Input 1:{"arr":["hello","world"],"delimiter":"-"}
Output 1:"hello-world"
Input 2:{"arr":["a","b","c"],"delimiter":", "}
Output 2:"a, b, c"

Loading editor...

Run your code to see results

Click the Run button above