Byte Array Strings

String Direct To Byte Array String sTemp; Byte[] TxData; sTemp = "Hello"; TxData = System.Text.Encoding.UTF8.GetBytes(sTemp); Byte Array To String System.Diagnostics.Debug.WriteLine("CommsByteArray: " + Encoding.UTF8.GetString(CommsByteArray));   string sTemp = Encoding.ASCII.GetString(new byte[]{ 41 }); Remove Nulls From The String sTemp = sTemp.Replace("\0", "");  

Read More

.Strings General

string or String string is an alias in C# for System.String.So technically there is no difference (it’s like int and System.Int32). Best practice: Use string any time you’re referring to an object. Use String if you need to refer specifically to the class. Multi Line Strings Use the ‘@’ character before the string to create […]

Read More