stringz

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 12 Imported by: 10

Documentation

Overview

Package stringz contains a set of utilities to deal with strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddURLDefaultPort added in v1.0.7

func AddURLDefaultPort(rawURL string) string

AddURLDefaultPort add url default port (80/443) from an URI eg: http://foo.com -> http://foo.com:80 https://foo.com -> https://foo.com:443

func Base64 added in v1.2.6

func Base64(bin []byte) string

Base64 returns base64 of given byte array

func FaviconHash added in v1.1.5

func FaviconHash(data []byte) (int32, string, error)

func GetInvalidURI added in v1.1.2

func GetInvalidURI(rawURL string) (bool, string)

func InsertInto added in v1.1.5

func InsertInto(s string, interval int, sep rune) string

func RemoveURLDefaultPort added in v1.0.7

func RemoveURLDefaultPort(rawURL string) string

RemoveURLDefaultPort remove url default port (80/443) from an URI eg: http://foo.com:80 -> http://foo.com https://foo.com:443 -> https://foo.com

func SplitByCharAndTrimSpace added in v1.0.1

func SplitByCharAndTrimSpace(s, splitchar string) (result []string)

SplitByCharAndTrimSpace splits string by a character and remove spaces

func StringToSliceInt added in v0.0.7

func StringToSliceInt(s string) ([]int, error)

StringToSliceInt converts string to slice of ints

func StringToSliceUInt32 added in v1.1.5

func StringToSliceUInt32(s string) ([]uint32, error)

StringToSliceUInt converts string to slice of ints

func TrimProtocol

func TrimProtocol(targetURL string, addDefaultPort bool) string

TrimProtocol removes the HTTP scheme from an URI

Types

This section is empty.

Jump to

Keyboard shortcuts

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