Hongmu Notes

🔗 Concatenate arrays into strings

Concatenate the JSON array into a line of text using custom connectors.

Concatenate arrays into strings

Instructions for use

  • Paste the JSON array, fill in the connectors and click "Splice"
  • If you add a backslash and n in the connector, it will become a real line break.
  • Array elements must be wrapped in double quotes. Single quotes will fail to parse.

JSON array concatenation

The interface often returns a JSON array. When copied directly into the document, a bunch of quotation marks and commas will appear; after splicing, it will be clean copywriting.

📌 Will quotes within elements be preserved?

No. After parsing, the quotes are just syntax markers, and the splicing result only contains the element content itself, so you can get plain text that can be used directly.

🧭 Common uses

It is very common to assemble the string array returned by the interface into display copy, the label array into a line of labels, the field name array into a SQL field list, and convert the array in the code into a string connected with commas or vertical bars; when multiple lines of text are required, use newline as the connector.

🔒 Dealing with location and privacy

The parsing and splicing are all done locally in the browser. There is no Internet access, no uploading, and no writing to local storage. It will be cleared after refreshing. When the results are exported to local files, they are only generated on your own computer, and the files only contain the result text.

All keywords and tutorials 12

❓ FAQ

What happens if there are commas in the element?
Retained as part of the string and will not be treated as a delimiter.
Can the original array format be retained?
No. The output on this page is the spliced ​​text.
Checkpoints for JSON array concatenation
After finishing the puzzle, take a look at the first and last elements to make sure you haven’t missed any element.