What method are you using to convert? Every char in the string is two
bytes in size, so if you are just converting the chars directly and not
using any particular encoding, the answer is string.Length * 2.
However, if you are using an encoding, you can either call
Encoding.GetByteCount() or simply call one of the Encoding.GetBytes()
overloads which returns an array of the right length. E.g.:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.