.NET Frame Class Save (Part 2)
(www.jojoo.net) 2001-6-5 (Please double-click the automatic scroll to watch, click Stop, then hit ..)
First, handle strings
The .NET Framework class (or SYSTEM class) provides a large number of core functions that can be used when constructing .NET applications, which apply to any locale. The first part of this article describes the basic concepts such as assemblies, namespaces, and System.math and System.random classes. This is the second part of this article, then discuss several other useful classes: System.String, System.Array, System.DateTime.
It is worth pointing out that as mentioned above, when we use VB.NET as a programming language, we often face this option: use the VB.NET language built-in function, or uses the equivalent SYSTEM class Features. We face this option when processing arrays, date / time, string data. If you used to be a VB 6.0 programmer, your first choice may be inspected and active. However, if possible, you'd better change the old habits and use the new .NET System class. why? Because the System class is used to make your code easier to port to other .NET languages and future VB.NET versions.
The SYSTEM.STRING class provides a wealth of string processing capabilities. Using the System.String class, we can: determine the length of the string, find the substrings, change the case of the string, compare two strings, split strings, and more.
Determine the length of the string is the length property. For example, in the following code, the value of intlength will be 4:
DIM STRCOLOR As String = "Blue" DIM INTLENGTH AS INTEGER INTLENGTH = STRCOLOR.LENGTH
We use the indexof method to find the first matching substring from the string. If the substring is found, the indexof method returns the start position of the sub-string (the start position of the first character is 0); if it is not found, INDEXOF returns -1. Indexof's lookup is sensitive. IndexOf is an overload method that allows incoming parameters including: Char type characters, string type strings, Char types of characters. The following this indexof.aspx page demonstrates the use of three different parameter type IndexOf methods:
<% @ Page language = "vb" explicit = "true"%>