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?

Midhun TpRank #388 · 6.5K reputationPosted Sep 2, 2016, 9:22 AM EDT
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
Vishal JadavRank #1,692 · 901 reputationPosted Sep 2, 2016, 11:21 PM EDT
Sahil Dev106 reputationPosted Sep 7, 2016, 8:54 AM EDT
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?
Tapan PatelRank #614 · 3.9K reputationPosted Sep 7, 2016, 9:52 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 12, 2016, 3:36 AM EDT