First convert the
String to Byte
. Then convert
Byte to SByte
.
byte[] abyte1 = new byte[4];
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
abyte1 = encoding.GetBytes(s1);
sbyte[] sbytes = Array.ConvertAll(abyte1, q => Convert.ToSByte(q));