VB.NET learning notes (object-oriented basic data types)

zhaozj2021-02-16  45

These basic types also have their own methods and properties like classes, skilled in use them to make your program more elegant and more object-oriented taste.

Basic types of important methods and attributes

DIM I as Int32

DIM S As String

DIM SS () AS STRING

Dim by as byte

DIM D As Double

DIM B As Boolean

DIM DA AS DATE

DIM C as char

DIM CC () as char

'Integer operation

I = int32.parse ("¥ 123", globalization.numberStyles.allowcurrencyssymbol) '123

i = int32.maxvalue '2147483647

I = int32.minvalue '-2147483648

By = byte.parse ("1") '1

'Floating point number operation

D = double.positiveInfinity 'is infinite

D = double.epsilon '4.94065645841247e-324

'Boolean operation

s = boolean.trueString 'True

'Date operation

Da = Date.MaxValue '9999-12-31 23:59:59

Da = date.minvalue '0:00:00

Da = Date.Now '2004-5-7 13:17:35

B = Date.isleApyear (2004) 'TRUE

I = Date.Daysinmonth (2004, 5) '31

'The following method used to determine the characteristics of characters

Char.iscontrol (c)

Char.isdigit (c)

Char.isletter (c)

Char.isletterRigit (c)

Char.islower (c)

Char.isnumber (c)

Char.ispunctuation (c)

Char.isseparator (c)

Char.issurrogate (C)

Char.issymbol (c)

Char.iswhitespace (C)

Char.isupper (c)

'Char conversion

CHAR.TOLOWER (C)

CHAR.TOUPPER (C)

'String operation

CC = S.ToChararray ()

ss = s.split (",")

s = s.substring (5, 3)

s = S.trim ()

转载请注明原文地址:https://www.9cbs.com/read-27041.html

New Post(0)