Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:08:19+00:00 2026-05-27T21:08:19+00:00

I have a about brackets like this {} in VB.net. I keep seeing syntax

  • 0

I have a about brackets like this {} in VB.net.

I keep seeing syntax like this in MSDN documentation and in VB.net tutorials.

  Dim pattern As String = "(\d{3})-(\d{3}-\d{4})"
  Dim input As String = "212-555-6666 906-932-1111 415-222-3333 425-888-9999"
  Dim matches As MatchCollection = Regex.Matches(input, pattern)
  For Each match As Match In matches
     Console.Write("Area Code:        {0}", match.Groups(1).Value)
  Next 

prints:
Area Code: 212
Area Code: 906
Area Code: 415
Area Code: 425

it seems vaguely like "this is a string {0}" , variable prints
“this is a string ” & valueOfVariable.ToString

But I have a few questions about the details of how this actually works:

  1. Does VB.net automatically assume that the curly brackets are holding a string parameter or does it depend on context. I’ve only seen this syntax as part of Console.WriteLine (I googled special characters vb.net 4.0 without luck)?
  2. What are the rules of when and how you can assign parameters into a string like this?
  3. Can anyone point me to the MSDN reference? What is this syntax/string trick called?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:08:20+00:00Added an answer on May 27, 2026 at 9:08 pm

    It is called String Formatting,

    http://msdn.microsoft.com/en-us/library/system.string.format.aspx

    It will accept any parameters and it will convert to its text representation based on the formatting specified, there are many ways to control how to format the given object (it can be string, number, date anything).

    Everything in .Net is derived from object and object has a method called ToString, which will return its string representation. So if number or anything else is passed to Format, this method will call ToString and use its string representation along with other settings.

    Most cases, this method will be used by some other high level methods, like in Console.WriteLine etc, but eventually they all do same.

    Composite Formatting

    http://msdn.microsoft.com/en-us/library/txafckwd.aspx

    Standard Numeric Formats

    http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

    Custom Numeric Formats

    http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

    You will have to read all related links in MSDN to get more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed
I have an old table which has a column like this 1 | McDonalds
I'm just about ready to cry. I have read the php.net manual page, tried
I have a variable string like such: [Text that changes]:SPACE: where the :SPACE: is
I have about 50 templates, and I would like to standardize whitespace on variables
Note: This is .NET regular expressions. I have a bunch of text, from which
Reading code from other posts, I'm seeing something like this. struct Foo { Foo()
I have this grammar of a C# like language, and I want to make
I have about 150 000 rows of data written to a database everyday. These
I have about 200 Excel files that are in standard Excel 2003 format. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.