Skip to content
/ headline Public

Package headline provides functionality to extract the first non-empty line from a string.

License

Notifications You must be signed in to change notification settings

goaux/headline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

headline

Package headline provides functionality to extract the first non-empty line from a string.

Go Reference Go Report Card

This package is useful for processing text data where the first meaningful line needs to be extracted, such as in configuration files, headers, or any text where leading empty lines or whitespace should be ignored.

The package contains a single function, Get, which efficiently processes the input string and returns the first line containing non-whitespace characters. The returned string does not include any newline characters.

Usage:

import "github.com/goaux/headline"

text := "   \n\nFirst line\nSecond line"
firstLine := headline.Get(text)
// firstLine will be "First line"

About

Package headline provides functionality to extract the first non-empty line from a string.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages