Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/string.js>lines

A JavaScript extension package for building strong and modern applications.
Latest
function lines
import { lines } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/string.js";

Splits the string into lines by \n or \r\n.

Examples

Example 1

import { lines } from "@ayonli/jsext/string";

console.log(lines("hello\nworld")); // ["hello", "world"]
console.log(lines("hello\r\nworld")); // ["hello", "world"]