Strings

Strings are supported by the .NET String class. The String data type can represent a series of characters and can contain approximately up to 2 billion Unicode characters. There are many built-in functions in the String class. Some .NET Framework function are also built into the String class. Some common String functions are discussed below:

  • LCase: Converts a string to lower case
  • UCase:Converts a string to uppercase
  • Len: Calculates the number of characters in the string
  • LTrim:Omits spaces that appear on the left-side of the string
  • RTrim:Omits spaces that appear on the Right-side of the string
  • Trim: Omits both leading and trailing spaces
  • Clone: Clones a string
  • Concat:Joins two strings
  • Space: Used to create a string with spaces
  • Left: Takes two arguments and return a string that consists of the left most characters of the string sent
  • Right: Takes two arguments and return a string that consists of the Right most characters of the string sent
  • Instr: Searches and return a shorter string within a long string
  • Replace:Searches for a small string in a long string and replace it with the specified string.

Arrays in ASP.NET

Arrays allows you to store a series of value that have the same data type. Each individual value in the array is accessed using one or more index number. It's often convenient to picture arrays as list of data (if the array has more then one dimension) or grids of data (if the array has two dimension). Typically, arrays are laid out contiguously in memory.
All arrays start start at a fixed lower bound. This rule has no exception. When you create an array in C#, you specify the numbers of elements.Because counting start at 0, the highest index is actually one fewer than the number of elements.

//Create an array with four string (from index 0 to index 3).

//You need to initialize the array with the new keyword in order to use it:
string[] vStringArray1=new string[4];

//Create a 2*4 grid array (with a total of 8 integers).
int[,] vIntArray1=new int[2,4];