String Management
Brian Bischof · Apress eBooks · 2002
String manipulation consists of using different functions to modify the contents of a string. String manipulation in VB 6.0 and .NET is very similar. Although VB 6.0 uses built-in functions to modify a string and .NET uses the System. String class members, you can see from Table 10-1 that the functionality is almost identical between the two. When you compare VB 6.0 to .NET, the biggest issue to be aware of is how the two languages differ when specifying the string that will be modified. VB 6.0 functions take an existing string as a parameter and return the new string. .NET uses a method of an existing string object and returns the modified string. Another important difference between VB 6.0 and the .NET classes is how you reference the first character in a string. The VB 6.0 and VB .NET built-in string functions assume the first character in a string is at index 1. The .NET classes assume the first character is at index 0. This chapter focuses on summarizing the different string manipulation methods found in the System.String class and the System.StringBuilder class. It also points out important differences between VB 6.0 and .NET. If you are more comfortable using the functions in VB 6.0, you can still use them in .NET. VB .NET includes all the functions by default.2 If you want to use them in C#, you need to include the library Microsoft.VisualBasic.NET RunTime in your project. The functions are in the Strings class.