The string contains 6 bytes which encode 5 characters : unicode « String « Ruby
- Ruby
- String
- unicode
The string contains 6 bytes which encode 5 characters
s = "2×2=4"
s.length # => 5: Characters: '2' '×' '2' '=' '4'
s.bytesize # => 6: Bytes (hex): 32 c3 97 32 3d 34
Related examples in the same category