I am trying to calculate the size in String bytes in Swift, but I do not know what character size is; how many bytes are encoded?
Say I have a line: let str = "hello, world"
I want to send this to my server, but my server will only accept strings under 32 bytes. How can I control the length of my string?
Randy source share