nl

package
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Split

func Split(text string) []string

Split divides the input text into a slice of strings, split by any newline sequence.

Types

type NL

type NL string // NL represents a newline character or sequence of characters.
const DefaultNewLine NL = "\n" // DefaultNewLine is the default newline character (line feed).

func Default

func Default(source string) (NL, string)

Default detects the newline sequence in the source string and returns it along with the source string where the detected newline sequences are replaced with the DefaultNewLine.

func (NL) Restore

func (newLine NL) Restore(s string) string

Restore replaces the DefaultNewLine sequences in the input string with the original newline sequence.

func (NL) String

func (newLine NL) String() string

String returns the NL as a string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL