-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trim prefix #65
trim prefix #65
Conversation
I don't understand why it's |
Cause it's a tail. |
Yes. I took a look at it more careful. You are right. It's stupid of me. Let me refactor this. |
Done! |
Thanks. I'll look this in later. |
runewidth_test.go
Outdated
@@ -380,6 +380,76 @@ func TestTruncateNoNeeded(t *testing.T) { | |||
} | |||
} | |||
|
|||
func Test_TrimPrefix(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove _
Thanks your contribution. I prefer the tests should be table-driven tests. See other tests. |
Sure. I should have written them similar. |
Hmm, I'm still wondering what is this use-case. Could you please explain how this can be useful? |
:) |
So instead of using |
So
Result of trimming 5 cells should be
|
Nope. And the result of
will be the same. I mean
|
Or... If so, on line
|
I've pushed the implementation with logic from above comment. |
Look good to me. |
Thank you |
Thank you too |
trim prefix method:
n
cells from the beginning of the stringprefix
to string if set