Types of String Manipulation Methods in Visual Basic
There are several different ways to analyze and manipulate your strings. Some of the methods are a part of the Visual Basic language, and others are inherent in the String class.
Visual Basic methods are used as inherent functions of the language. They may be used without qualification in your code. The following example shows typical use of a Visual Basic string-manipulation command:
In this example, the Mid function performs a direct operation on aString and assigns the value to bString.
For a list of Visual Basic string manipulation methods, see String Manipulation Summary (Visual Basic).
You can also manipulate strings with the methods of the String class. There are two types of methods in String: shared methods and instance methods.
A shared method is a method that stems from the String class itself and does not require an instance of that class to work. These methods can be qualified with the name of the class (String) rather than with an instance of the String class. For example:
In the preceding example, the StringCopy method is a static method, which acts upon an expression it is given and assigns the resulting value to bString.
Instance methods, by contrast, stem from a particular instance of String and must be qualified with the instance name. For example:
In this example, the StringSubstring method is a method of the instance of String (that is, aString). It performs an operation on aString and assigns that value to bString.
For more information, see the documentation for the String class.