Remove trailing whitespaces when using --with-nth

This commit is contained in:
Junegunn Choi committed 2019-11-12 23:20:09 +09:00
1 parent 05b5f3f845
commit 751aa1944a
2 files changed
+6

No files matched your search

+5
View File
@@ -142,6 +142,11 @@ func (chars *Chars) TrailingWhitespaces() int {
return whitespaces
}
func (chars *Chars) TrimTrailingWhitespaces() {
whitespaces := chars.TrailingWhitespaces()
chars.slice = chars.slice[0 : len(chars.slice)-whitespaces]
}
func (chars *Chars) ToString() string {
if runes := chars.optionalRunes(); runes != nil {
return string(runes)