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

x/ayonli_jsext/string/index.ts>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/string/index.ts";

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"]

Parameters

str: string

Returns

string[]