Blog VS 2010 All Tutorials Wordpress Studio
Certification LinksRandom Thoughts

C# String Object

String Trim Method

Jul 8th, 2010 | By | Category: C# String Object, Tutorials

The source code for this demonstration is located in the zip file “WorkingWithStrings” Trim Spaces There are actually 3 methods associated with the string object available to trim leading and trailing space: TrimStart() | TrimEnd() | Trim() The results are self explanatory and the syntax is very simple. //declare variables to work with string strFirst [...]



String Length Property

Jun 5th, 2010 | By | Category: C Sharp, C# String Object, Tutorials

The source code for this demonstration is located in the zip file “WorkingWithStrings” Length is a property of the string object string.Length is useful in determining valid data. However, don’t get in to the habbit of using this property for everything. Remember that getting in a rut as a programmer by using only a few [...]



String Compare Method

May 26th, 2010 | By | Category: C Sharp, C# String Object, Tutorials

String Compare is a method that will compare 2 strings and returns an integer. ( 0 = alike and 1 = different).



String Concatenation

May 26th, 2010 | By | Category: C Sharp, C# String Object, Tutorials

String concatenation is one of the commonly used operations among programmers.
If you don’t handle the string concatenation in .NET properly, you may decrease performance
so it’s important to keep in mind what you are trying to accomplish.



String Contains Method

May 26th, 2010 | By | Category: C Sharp, C# String Object, Tutorials

Download the source code Definition: Returns a value (true/false) indicating whether the specified String object occurs within another specifice String object. Contains Method Syntax: // This example demonstrates the String.Contains() method using System; string str1 = ‘All good men come to the aid of their country’; string str2 = ‘country’; bool bResult = false; bResult [...]



String Compare

May 13th, 2010 | By | Category: C# String Object, Tutorials

String Compare is a method that will compare 2 strings and returns an integer. ( 0 = alike and 1 = different). The syntax: set a variable to collect the results: int intCompareResults; //set the value of intCompareResults intCompareResults = String.Compare(‘hello’,’Hello’); intCompareResults will = 1 because hello and Hello are not seen as the same [...]