Name
Format Function
Class
Microsoft.VisualBasic.Strings
Syntax
Format(expression[, style[, dayofweek[, _
weekofyear]]]
)
-
expression
Use: Required
Data Type: String/Numeric
Any valid string or numeric expression
-
style
Use: Optional
Data Type: String
A valid named or user-defined format expression
-
dayofweek
Use: Optional
Data Type:
FirstDayOfWeek
enumerationA constant that specifies the first day of the week
-
weekofyear
Use: Optional
Data Type:
FirstWeekOfYear
enumerationA constant that specifies the first week of the year
First Day of Week Constants
Constant |
Value |
Description |
---|---|---|
|
0 |
NLS API setting |
|
1 |
Sunday (default) |
|
2 |
Monday |
|
3 |
Tuesday |
|
4 |
Wednesday |
|
5 |
Thursday |
|
6 |
Friday |
|
7 |
Saturday |
First Week of Year Constants
Constant |
Value |
Description |
---|---|---|
|
0 |
Use the NLS API setting. |
|
1 |
Start with the week in which January 1 occurs (default). |
|
2 |
Start with the first week that has at least four days in the new year. |
|
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.
Rules at a Glance
style
can be either a predefined or user-defined format.User-defined formats for numeric values are created with up to four sections, delimited by semicolons. Each section is used for a different ...
Get VB .NET Language in a Nutshell 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.