Skip to content

Commit

Permalink
feat(ansi): add Strip method
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 22, 2024
1 parent 54c5365 commit 04cef54
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansi/width.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func Strip(s string) string {
return buf.String()
}

// Strip removes ANSI escape codes from a string.
func (m Method) Strip(s string) string {
return Strip(s)
}

// StringWidth returns the width of a string in cells. This is the number of
// cells that the string will occupy when printed in a terminal. ANSI escape
// codes are ignored and wide characters (such as East Asians and emojis) are
Expand Down

0 comments on commit 04cef54

Please sign in to comment.