Categorygithub.com/agrison/go-commons-lang
module
0.0.0-20240106075236-2e001e6401ef
Repository: https://github.com/agrison/go-commons-lang.git
Documentation: pkg.go.dev

# README

go-commons-lang

MIT License Go Documentation Go Report Card

This is a package aiming at regrouping common utilities where it makes sense in the Go language. It originated as a port of the popular Java Apache Commons StringUtils, but more will be added gradually.

PackageDescription
stringUtilsString Utilities reflecting what's available in StringUtils
wordUtilsString Utilities regarding words WordUtils
randUtilsRandomUtils
mathUtilsFraction implementation of Apache Commons

Usage: stringUtils

package main

import (
	"fmt"
	strUtil "github.com/agrison/go-commons-lang/stringUtils"
)

func main() {
	lib := strUtil.Join([]string{"lang", "commons", "go"}, "-")
	fmt.Print(strUtil.Capitalize(strUtil.Reverse("olleh")))
	fmt.Print(strUtil.SwapCase(strUtil.Chomp(" fROM \n")))
	fmt.Println(strUtil.ReverseDelimited(lib, "-") + strUtil.Right("Go!! ", 2))
	// Output: Hello From go-commons-lang!
  // See the doc for all the implemented utilities
}

Installation

go get github.com/agrison/go-commons-lang

Join

PRs are more than welcome :)

Author

Alexandre Grison and obviously all the contributors of the original Apache Commons Lang.

# Packages

Package mathUtils provides utilities regarding mathematics.
Package randUtils provides some utilities regarding random numbers.
Package stringUtils provides various string utilities.
Package wordUtils provides some string utilities regarding words.