L leongcc Member Licensed User Longtime User Jan 25, 2013 #1 When the string=null, GetBytes() returns a byte array with arbituary values. When the string="", GetBytes() returns null. Is this behaviour normal ? The codes are test codes. B4X: Dim s As String = Null Dim a() As Byte a = s.GetBytes("UTF8")
When the string=null, GetBytes() returns a byte array with arbituary values. When the string="", GetBytes() returns null. Is this behaviour normal ? The codes are test codes. B4X: Dim s As String = Null Dim a() As Byte a = s.GetBytes("UTF8")
Erel B4X founder Staff member Licensed User Longtime User Jan 27, 2013 #2 Test the value of s. It will be "null". When the string="", GetBytes() returns null. Click to expand... It returns an empty array, not null. Upvote 0
Test the value of s. It will be "null". When the string="", GetBytes() returns null. Click to expand... It returns an empty array, not null.