XbabylonX Posted January 26, 2017 Share Posted January 26, 2017 Hello,is there any way to calculate the total bytes of a string?Thank you Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 26, 2017 Share Posted January 26, 2017 You might get some ideas from http://wiki.secondlife.com/wiki/LSL_Script_Memory Link to comment Share on other sites More sharing options...
XbabylonX Posted January 27, 2017 Author Share Posted January 27, 2017 "Hello, this is Babylon ♥" Could you tell me the total bytes of this? And which code you used to get it? Thank you. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 27, 2017 Share Posted January 27, 2017 That character string has 24 characters. A UTF-16 character takes 2 bytes of memory in Mono, so it will use 48 bytes of memory when compiled. See https://en.wikipedia.org/wiki/UTF-16 1 Link to comment Share on other sites More sharing options...
XbabylonX Posted January 27, 2017 Author Share Posted January 27, 2017 So its always string length*2? Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 27, 2017 Share Posted January 27, 2017 As far as I am aware, yes. Link to comment Share on other sites More sharing options...
XbabylonX Posted January 27, 2017 Author Share Posted January 27, 2017 Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now