Skip to content

🐣 StrLib is a Go module that provides utilities for working with strings.

Notifications You must be signed in to change notification settings

mutasim77/strlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StrLib 🧵

StrLib is a versatile string manipulation library for Go, designed to make working with strings easy and efficient. With StrLib, you can perform various operations such as reversing strings, counting symbols, and much more.

🛠️ Features

  • Reverse: Reverse strings effortlessly with the Reverse function.
  • SymbolCount: Count the number of symbols (Unicode characters) in a string using the SymbolCount function.

📦 Installation

To start using StrLib in your Go projects, simply install it using go get:

go get github.com/mutasim77/strlib

For a new version:

go get github.com/mutasim77/strlib/v2

💡 Usage

package main

import (
	"fmt"

	str "github.com/mutasim77/strlib"
	str2 "github.com/mutasim77/strlib/v2"
)

func main() {
	reversed := str.Reverse("Hello, 世界! How are you?")
	fmt.Println(reversed) // Output: ?uoy era woH !界世 ,olleH

	// Count symbols in a string
	count := str2.SymbolCount("Hello, 世界!")
	fmt.Println(count) // Output: 10
}

📝 Versioning

StrLib follows semantic versioning (SemVer). Currently, the main module github.com/mutasim77/strlib includes only the Reverse function. Version 2 (v2) introduces a new function called SymbolCount.

Note

If you're using the github.com/mutasim77/strlib module, you'll have access only to the Reverse function. To use the SymbolCount function, make sure to import version 2 of the module github.com/mutasim77/strlib/v2.