Skip to content

Commit 8403dc8

Browse files
committed
docs: add splitByLineBreak function example
1 parent 7eed521 commit 8403dc8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ const cleaned = removeSuffix(".js", "script.js"); // "script"
110110
// String joining and splitting
111111
const path = join("/", "home", "user", "docs"); // "/home/user/docs"
112112
const parts = split("-", "hello-world-js"); // ["hello", "world", "js"]
113+
114+
// Split string by line breaks (handles both \n and \r\n)
115+
const lines = splitByLineBreak("line1\nline2\r\nline3");
116+
console.log(lines); // ["line1", "line2", "line3"]
113117
```
114118

115119
#### Promise Utilities
@@ -499,6 +503,7 @@ Common utilities for everyday programming tasks:
499503
export {
500504
template,
501505
unindent,
506+
indent,
502507
addPrefix,
503508
addSuffix,
504509
removePrefix,
@@ -508,6 +513,7 @@ export {
508513
splitWithSlash,
509514
joinWithSlash,
510515
toForwardSlash,
516+
splitByLineBreak,
511517
concatTemplateStrings,
512518
};
513519

0 commit comments

Comments
 (0)