Skip to content

Commit

Permalink
minor changes on README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jagottsicher committed Oct 7, 2022
1 parent 2ea1b06 commit 9908540
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ myGoToolbox is a package which contains a collection of useful functions and han
go get github.com/jagottsicher/myGoToolbox
```
## Features

#### escapeStringRegex.go
`EscapeStringRegex` EscapeStringRegex returns a string that escapes all regular expression metacharacters inside the aurgumnent of type string like `\.+*?()|[]{}^` and returns a string which is a regular expression matching the literal text.

```
func Separate(N interface{}, lang string) (string, error)
```

Example:
```
package main
import (
"fmt"
"github.com/jagottsicher/myGoToolbox"
)
func main() {
s := `How much $ for a 🦄?`
fmt.Println(EscapeStringRegex(s))
// Output:
// How much \$ for a 🦄\?
}
```
#### terminal.go
`Clearscreen()` empties the terminal screen independently from the underlying operation system by calling the OS's built-in functions works smootly even on both Windows' cmd.exe and powershell.
#### thousands.go
thousands.go mainly consists of the function `Separate()` which adds thousands separators to numbers. It takes two arguments: the number and a language-code you want to use. It returns a string with thousands separators as commonly used in this lang/region. Actually `Separate()` supports English, German and French (intl. recommended) notation. More information about [decimal separators](https://en.wikipedia.org/wiki/Decimal_separator).

Expand Down Expand Up @@ -39,6 +67,4 @@ func main() {
// 1.232.323,123456789
// 1 232 323,123456789
}
```
#### terminal.go
`Clearscreen()` empties the terminal screen independently from the underlying operation system by calling the OS's built-in functions works smootly even on both Windows' cmd.exe and powershell.
```

0 comments on commit 9908540

Please sign in to comment.