File: trim.go

package info (click to toggle)
golang-github-evilsocket-islazy 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: javascript: 8; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package str

import (
	"strings"
)

const (
	whiteSpaceTrimSet = "\r\n\t "
)

// Trim trims a string from white spaces.
func Trim(s string) string {
	return strings.Trim(s, whiteSpaceTrimSet)
}

// TrimRight trims the right part of a string from white spaces.
func TrimRight(s string) string {
	return strings.TrimRight(s, whiteSpaceTrimSet)
}

// TrimLeft trims the left part of a string from white spaces.
func TrimLeft(s string) string {
	return strings.TrimLeft(s, whiteSpaceTrimSet)
}