strutils

package module
v0.0.0-...-2e79743 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 2 Imported by: 0

README

strutils

strutils is a small library written in Go for demonstrating how to write a package from scratch. It includes small utility involving strings.


Installation

Go to you project root, where go.mod exists. Then run the following command in your shell:

go get github.com/byhowe/strutils

Usage

package main

import (
	"fmt"

	"github.com/byhowe/strutils"
)

func main(){
	reversed, err := strutils.Reverse("byhowe")
	if err != nil {
		log.Fatal(err)
	}    
	fmt.Println(reversed) // ewohyb
}

Contributor(s)

License

The project is under MIT license.

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrInvalidUTF8 = errors.New("input is not a valid UTF-8")

Functions

func Reverse

func Reverse(s string) (string, error)
Example
package main

import (
	"fmt"

	"github.com/byhowe/strutils"
)

func main() {
	r, _ := strutils.Reverse("vigo")
	fmt.Println(r)
}
Output:

ogiv

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL