1
0
Fork 0
Golang library that allows you to control the end of lines.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Leonid Maslakov e7f50d611d Add CHANGELOG.md 1 year ago
CHANGELOG.md Add CHANGELOG.md 1 year ago
LICENSE first commit 1 year ago
README.md first commit 1 year ago
go.mod first commit 1 year ago
lineend.go first commit 1 year ago
lineend_test.go first commit 1 year ago

README.md

LineEnd - is a very simple library that allows you to control the end of lines.

Installing

Add the following to your go.mod file:

require git.lcomrade.su/root/lineend v1

Using

The library is very easy to use. Here is the documentation:

Function Description
GetLineEnd (text string) string Allows you to get the end of a line used in the text. It can return \r\n, \r, \n or an empty string.
DosToOldMac (text string) string Converts end of line from CRLF to CR.
DosToUnix (text string) string Converts end of line from CRLF to LF.
OldMacToDos (text string) string Converts end of line from CR to CRLF.
OldMacToUnix (text string) string Converts end of line from CR to LF.
UnixToDos (text string) string Converts end of line from LF to CRLF.
UnixToOldMac (text string) string Converts end of line from LF to CR.
UnknownToDos (text string) string Converts unknown line end to CRLF.
UnknownToOldMac (text string) string Converts unknown line end to CR.
UnknownToUnix (text string) string Converts unknown line end to LF.