File: remove_and_count_prefix.go

package info (click to toggle)
golang-github-pterm-pterm 0.12.79-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,640 kB
  • sloc: makefile: 4
file content (11 lines) | stat: -rw-r--r-- 221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
package internal

import (
	"strings"
)

func RemoveAndCountPrefix(input, subString string) (string, int) {
	inputLength := len(input)
	input = strings.TrimLeft(input, subString)
	return input, inputLength - len(input)
}