.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

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

Encode/Decode Strings

HtmlEncode Enabling HttpUtility for projects By default your app probably can't see "System.Web.HttpUtility".  You need to include a reference to System.Web. Right-click your project in the Solution Explorer > Add Reference > Assemblies > Framework > Scroll to System.Web and enable it  

Read More

Using Strings-Extracting

Convert comma seperated string to a list Get string from character position # (Remove text from beginning or end of string) Getting beginning of a string Getting end of string

Read More