From 04cef54f973888f6a9774552b1cabe52337cd4c9 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 22 Oct 2024 17:56:05 -0400 Subject: [PATCH] feat(ansi): add Strip method --- ansi/width.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansi/width.go b/ansi/width.go index f39ffe88..5cf4a20a 100644 --- a/ansi/width.go +++ b/ansi/width.go @@ -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