Skip to content

Go module that provides the same string constants available in the Python standard library

License

MIT, Unknown licenses found

Licenses found

MIT
LICENCE
Unknown
licence.svg
Notifications You must be signed in to change notification settings

sashsinha/strconsts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strconsts logo

String Constants

Go module that provides the same string constants available in the Python string module

License: MIT Godoc

Avaliable Constants

strconsts.ASCIILetters

The concatenation of the ASCIILowercase and ASCIIUppercase constants described below. This value is not locale-dependent.

strconsts.ASCIILowercase

The lowercase letters 'abcdefghijklmnopqrstuvwxyz'. This value is not locale-dependent and will not change.

strconsts.ASCIIUppercase

The uppercase letters 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. This value is not locale-dependent and will not change.

strconsts.Digits

The string '0123456789'.

strconsts.HexDigits

The string '0123456789abcdefABCDEF'.

strconsts.OctDigits

The string '01234567'.

strconsts.Punctuation

String of ASCII characters which are considered punctuation characters in the C locale: !"#$%&'()*+,-./:;<=>?@[\]^`{|}~.

strconsts.Printable

String of ASCII characters which are considered printable. This is a combination of Digits, ASCIILetters, Punctuation, and Whitespace.

strconsts.Whitespace

A string containing all ASCII characters that are considered whitespace. This includes the characters space, tab, linefeed, return, formfeed, and vertical tab.

Installation

Standard go get:

$ go get github.com/sashsinha/strconsts

Example Usage

package main

import (
    "fmt"
    "github.com/sashsinha/strconsts"
)

func main() {
    fmt.Println("ASCIILetters:", strconsts.ASCIILetters)
    fmt.Println("ASCIILowercase:", strconsts.ASCIILowercase)
    fmt.Println("ASCIIUppercase:", strconsts.ASCIIUppercase)
    fmt.Println("Digits:", strconsts.Digits)
    fmt.Println("HexDigits:", strconsts.HexDigits)
    fmt.Println("OctDigits:", strconsts.OctDigits)
    fmt.Println("Punctuation:", strconsts.Punctuation)
    fmt.Println("Printable:", strconsts.Printable)
    fmt.Println("Whitespace:", strconsts.Whitespace)
}

Output:

ASCIILetters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
ASCIILowercase: abcdefghijklmnopqrstuvwxyz
ASCIIUppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Digits: 0123456789
HexDigits: 0123456789abcdefABCDEF
OctDigits: 01234567
Punctuation: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Printable: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~



Whitespace:




About

Go module that provides the same string constants available in the Python standard library

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENCE
Unknown
licence.svg

Stars

Watchers

Forks

Packages

No packages published

Languages