Code PublicFunction GetBytesSubChar(ByVal s AsString, ByVal CharCount AsInteger) AsString Dim strRtn AsString="" Dim bytArray() AsByte Dim chrArray() AsChar Dim intI AsInteger
bytArray = System.Text.Encoding.Default.GetBytes(s) If CharCount > System.Text.Encoding.Default.GetCharCount(bytArray) Then
strRtn = s Else
chrArray = System.Text.Encoding.Default.GetChars(bytArray, 0, CharCount) For intI =0To chrArray.Length -1
strRtn = strRtn & chrArray(intI) Next EndIf Return strRtn End Function