BTool.DeviceFormUtils.String2UInt16_LSBMSB C# (CSharp) Method

String2UInt16_LSBMSB() public method

public String2UInt16_LSBMSB ( string str, byte radix ) : ushort[]
str string
radix byte
return ushort[]
        public ushort[] String2UInt16_LSBMSB(string str, byte radix)
        {
            ushort[] numArray;
            try
            {
                if (radix != 0xff)
                {
                    string[] strArray = str.Split(new char[3] { ' ', ':', ';' });
                    numArray = new ushort[strArray.Length];
                    for (int index = 0; index < strArray.Length; ++index)
                        try
                        {
                            if (strArray[index] == string.Empty)
                                return null;
                            numArray[index] = Convert.ToUInt16(strArray[index], (int)radix);
                        }
                        catch
                        {
                            return null;
                        }
                }
                else
                    numArray = null;
            }
            catch
            {
                return null;
            }
            return numArray;
        }