package stringutil
import "github.com/teamwork/utils/stringutil"
Package stringutil adds functions for working with strings.
Index ¶
- func GetLine(in string, n int) string
- func Left(s string, n int) string
- func LowerFirst(s string) string
- func RemoveUnprintable(s string) string
- func StripWhitespaces(str string) string
- func Truncate(s string, n int) string
- func UpperFirst(s string) string
Functions ¶
func GetLine ¶
GetLine gets the nth line \n-denoted line from a string.
func Left ¶
Left returns the "n" left characters of the string.
If the string is shorter than "n" it will return the first "n" characters of the string with "…" appended. Otherwise the entire string is returned as-is.
func LowerFirst ¶
LowerFirst transforms the first character to lower case, leaving the rest of the casing alone.
func RemoveUnprintable ¶
RemoveUnprintable removes unprintable characters (0 to 31 ASCII) from a string.
func StripWhitespaces ¶
StripWhitespaces removes every whitespace in a string.
func Truncate ¶
Truncate returns the "n" left characters of the string.
func UpperFirst ¶
UpperFirst transforms the first character to upper case, leaving the rest of the casing alone.
Source Files ¶
- Version
- v1.0.0 (latest)
- Published
- Mar 14, 2022
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 20 hours ago –
Tools for package owners.