Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 492 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 492 Bytes

strmod

strmod allows to modify string in very readable way.

It is helpful when you need to do multiple operations on single string, like trimming, replacing etc.

Currently it supports most string operations from stdlib strings package and few custom made.

in := "Some text/Other text/Something else "

out := strmod.Modify(in,
	strmod.SplitAndReturnLastPart("/"),
	strmod.TrimSpace(),
	strmod.ReplaceAll(" ", "_"),
	strmod.ToLower(),
)
fmt.Println(out)
// something_else