How to use the Add Prefix & Suffix to Lines
- Paste your lines.
- Type what to add before and after each line.
- Copy the result.
What does this tool do?
Handy for turning a list into code or markup: wrap each line in quotes and add a comma to build an array, add <li> tags for HTML, or put a dash in front for a bullet list.
Use {n} anywhere in the prefix or suffix to insert the line number. Empty lines can be skipped so numbering stays tidy.
Why use it?
- Prefix and suffix together.
- {n} line numbering.
- Skips empty lines.
Example
Prefix ' and suffix ', turns apple / banana into 'apple', / 'banana', — ready to paste into code.
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.