Created
January 17, 2021 12:53
-
-
Save Isomorph70/6d3f3c6675d10b4287a8179f1cf534ca to your computer and use it in GitHub Desktop.
ruby split join error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a='/a/test' | |
b=a.split('/').join('/') | |
puts "Fail start split!!!" if a!=b | |
a='a/test/' | |
b=a.split('/').join('/') | |
puts "Fail end split!!!" if a!=b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
split fail to make a split if the separating character is in the end, a reversal with join will not work in this situation.
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]
shs@cyonic ~/dev/triee_dir $ ruby split_join_test.rb
Fail end split!!!