loading
main.rb
1
2
3
4
5
6
7
8
9
10
# The length of the mobile number being sent from the client was being reported incorrectly
mobile_num = "+919876⁤543210"
puts "Length of the mobile_num: #{mobile_num.length}"

# Just in case you thought that String#length is at fault, 
# here is an example of it working properly
random_string = "12345678"
puts "Length of the random_string is: #{random_string.length}"

# If you find the answer, please put a comment on: http://vaibhavkaushal.com/posts/the-string-length-problem/
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]