Add Prefix / Suffix API

Category: text

Add text before or after each line. Runs entirely in the browser.

Endpoint

N/A Browser API (JavaScript)
No Server API

Response

Content-Type: N/A

This tool processes text in the browser using JavaScript. No server-side API is available.

// Browser-only: prefix/suffix added per line

cURL Example

# No cURL equivalent — this tool runs in the browser

Code Samples

// Add prefix and suffix to each line
const result = text.split('\n')
    .map(line => prefix + line + suffix)
    .join('\n');
# Add prefix and suffix to each line
result = '\n'.join(prefix + line + suffix for line in text.split('\n'))
// Add prefix and suffix to each line
String result = Arrays.stream(text.split("\n"))
    .map(line -> prefix + line + suffix)
    .collect(Collectors.joining("\n"));