Skip to content
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

builtin: fix string.trim() (fix #13021) #22205

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Sep 12, 2024

This PR fix string.trim() (fix #13021).

  • Fix string.trim().
  • Add test.
fn main(){
	s := 'あいうえお'
	println(s)
	ts := s.trim('あい')
	println(ts)
}

PS D:\Test\v\tt1> v run .
あいうえお
うえお

vlib/builtin/string.v Outdated Show resolved Hide resolved
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 6eae77b into vlang:master Sep 13, 2024
79 checks passed
@yuyi98 yuyi98 deleted the fix_string_trim_utf8 branch September 13, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

string.trim() does not work with unicode correctly
2 participants