arrayKit

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 3 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	IndexNotFound = -1 // 数组中元素未找到的下标,值为-1
)

Variables

This section is empty.

Functions

func BinarySearchIndexOf added in v0.2.6

func BinarySearchIndexOf(strs []string, char string) bool

BinarySearchIndexOf 二分查找是否存在元素

func BubbleAscSort added in v0.1.1

func BubbleAscSort(strs []string) []string

BubbleAscSort 冒泡排序 正序 *

  • @param values 待排序的字符串数组
  • @return 排序后的字符串数组

func BubbleDescSort added in v0.1.1

func BubbleDescSort(strs []string) []string

BubbleDescSort 冒泡排序 倒序 *

  • @param values 待排序的字符串数组
  • @return 排序后的字符串数组

func Compare added in v0.1.1

func Compare(a, b []string) bool

Compare 比较两个字符串数组是否相等 *

  • @param a 字符串数组a
  • @param b 字符串数组b
  • @return true:相等 false:不相等

func Contains

func Contains(strs []string, char string) bool

Contains 数组中是否包含元素 *

  • @param strs 数组
  • @param value 被检查的元素
  • @return 包含返回true,否则返回false

func IndexOf

func IndexOf(strs []string, char string) int

IndexOf 返回数组中指定元素所在位置,未找到返回IndexNotFound *

  • @param strs 字符串数组
  • @param char 被检查的元素
  • @return 数组中指定元素所在位置,未找到返回IndexNotFound

func JoinStringsInASCII added in v0.1.1

func JoinStringsInASCII(data map[string]string, sep string, onlyValues, includeEmpty bool, exceptKeys ...string) string

JoinStringsInASCII 将map数据key以ASCII码从小到大排序后拼接 *

  • @param data 待拼接的数据
  • @param sep 连接符
  • @param onlyValues 是否只包含参数值,true则不包含参数名,否则参数名和参数值均有
  • @param includeEmpty 是否包含空值,true则包含空值,否则不包含,注意此参数不影响参数名的存在
  • @param exceptKeys 被排除的参数名,不参与排序及拼接
  • @return 返回URL类型的参数字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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