Skip to content
/ strc Public

The package contains functions to convert string to desired state. The package functions have positive bias towards use of std go library to reduce dependency.

License

Notifications You must be signed in to change notification settings

wtfuk/strc

Repository files navigation

strc

The strc package provides utilities for working with strings in Go.

Installation

To install the strc package, use the go get command:

go get github.com/wtfuk/strc

Usage

Import the strc package in your code and call the functions as needed:

package main

import (
 "fmt"

 "github.com/wtfuk/strc"
)

func main() {
 str := "hello, world"
 titleCaseStr := strc.ToTitleCase(str)
 fmt.Println(titleCaseStr) // Output: "Hello, World"
}

Functions

The strc package provides the following functions:

ToTitleCase

The ToTitleCase function converts a string to title case.

ToTitleCase(str string) string

PadSpaceToRight

The PadSpaceToRight function pads spaces to the right of the given string.

PadSpaceToRight(str string, len int) string

Examples

strc.ToTitleCase("this does title cases") // output: This Does Title Cases

strc.PadSpaceToRight("123", 6) // output: This will add 3 spaces to the right of "123"

License

The strc package is licensed under the MIT License. See the LICENSE file for details.

About

The package contains functions to convert string to desired state. The package functions have positive bias towards use of std go library to reduce dependency.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages