Name

Format Function — Microsoft.VisualBasic.Strings

Synopsis

Format(expression[, style[, dayofweek[,  weekofyear]]])
expression required; String/Numeric

Any valid string or numeric expression

style optional; String

A valid named or user-defined format expression

dayofweek optional; FirstDayOfWeek enumeration

A constant that specifies the first day of the week, as shown in the following table:

Constant

Value

Description

System

0

NLS API setting

Sunday

1

Sunday (default)

Monday

2

Monday

Tuesday

3

Tuesday

Wednesday

4

Wednesday

Thursday

5

Thursday

Friday

6

Friday

Saturday

7

Saturday

weekofyear optional; FirstWeekOfYear enumeration

A constant that specifies the first week of the year, as shown in the following table:

First Week of Year Constants

Constant

Value

Description

UseSystemDayOfWeek

0

Use the NLS API setting

FirstJan1

1

Start with the week in which January 1 occurs (default)

FirstFourDays

2

Start with the first week that has at least four days in the new year

FirstFullWeek

3

Start with first full week of the year

Return Value

A string containing the formatted expression

Description

Allows you to use either predefined or user-defined formats to output string, numeric, and date/time data.

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.