elvish: github.com/elves/elvish/pkg/strutil Index | Files

package strutil

import "github.com/elves/elvish/pkg/strutil"

Package strutil provides string utilities.


Package Files

camel_to_dashed.go chop.go eol_sol.go strutil.go subseq.go

func CamelToDashed Uses

func CamelToDashed(camel string) string

CamelToDashed converts a CamelCaseIdentifier to a dash-separated-identifier, or a camelCaseIdentifier to a -dash-separated-identifier.

func ChopLineEnding Uses

func ChopLineEnding(s string) string

ChopLineEnding removes a line ending ("\r\n" or "\n") from the end of s. It returns itself if it doesn't end with a line ending.

func FindFirstEOL Uses

func FindFirstEOL(s string) int

FindFirstEOL returns the index of the first '\n'. When there is no '\n', the length of s is returned.

func FindLastSOL Uses

func FindLastSOL(s string) int

FindLastSOL returns an index just after the last '\n'.

func HasSubseq Uses

func HasSubseq(s, t string) bool

HasSubseq determines whether s has t as its subsequence. A string t is a subsequence of a string s if and only if there is a possible sequence of steps of deleting characters from s that result in t.

Package strutil imports 3 packages (graph) and is imported by 2 packages. Updated 2020-09-28. Refresh now. Tools for package owners.