Can anyone tell me the number of bytes each string takes in C#?
That is: if I have:
- string value = "thisIsMyName"
Then, how many bytes does the variable value take?
Because, if I have:
If I want to convert to convert value into into a c# byte array how many bytes does it take?
Nitin SontakkePosted Sep 12, 2016, 7:36 AM
Tapan PatelPosted Sep 7, 2016, 1:52 PM
Sahil DevPosted Sep 7, 2016, 12:54 PM
Each character is taking 1 byte according to me
Because, if I have 4 characters : "NONE", the byte array returned through the below code has byte array of dimension 4.. Can anyone confirm if this is right?
Vishal JadavPosted Sep 3, 2016, 3:21 AM
Midhun TpPosted Sep 2, 2016, 1:22 PM
http://www.dotnetperls.com/string-memory
http://www.abstractpath.com/2012/size-of-a-csharp-string/
http://stackoverflow.com/questions/3967411/how-many-bytes-will-a-string-take-up