public static byte[] StringToBytes(string textIn) { byte[] bs2; if (textIn == null) { return null; } byte[] bs1 = new UnicodeEncoding().GetBytes(textIn); float f1 = 0.0F; float f3 = Information.UBound(bs1, 1); for (float f2 = 0.0F; FlowControl.ForNextCheckR4(f2, f3, 1.0F); f2++) { if (bs1[(int)Math.Round((double)f2)] != 0) { bs2 = (byte[])Utils.CopyArray((Array)bs2, new byte[(int)Math.Round((double)f1) + 1]); bs2[(int)Math.Round((double)f1)] = bs1[(int)Math.Round((double)f2)]; f1++; } } return bs2; } }