Lindenii Project Forge
Login

go-lindenii-common

Common library for the Lindenii Project
Commit info
ID
4418b48e5c6e2c9ded023519c457430098bf6df5
Author
Runxi Yu <me@runxiyu.org>
Author date
Fri, 21 Mar 2025 14:56:43 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Fri, 21 Mar 2025 14:56:43 +0800
Actions
mailkit: Remove underscores
package mailkit

// Strip_angle_brackets strips a single "<" from the
// StripAngleBrackets strips a single "<" from the
// front of the string and a single ">" from the back
// of the string. If either are present, stripped
// returns true; if both are present, balanced also
// returns true.
func Strip_angle_brackets(x string) (result string, stripped bool, balanced bool) {
func StripAngleBrackets(x string) (result string, stripped bool, balanced bool) {
	var tmp string
	if x[0] == '<' {
		tmp = x[1:]
		stripped = true
	} else {
		tmp = x
	}
	if tmp[len(tmp)-1] == '>' {
		result = tmp[:len(tmp)-1]
		if stripped {
			balanced = true
		} else {
			stripped = true
		}
	} else {
		result = tmp
	}
	return
}