Skip to the content
  • Posts
    • Company stuff
    • Databases
    • Decisions
    • Learning
    • Leisure and Pleasure
    • Products and Services
    • Programming
    • System Administration
    • Technologies
    • Thoughts
  • About
  • CV
  • Contact
Solving tech problems

We can not solve our problems with the same level of thinking that created them.

  • Posts
    • Company stuff
    • Databases
    • Decisions
    • Learning
    • Leisure and Pleasure
    • Products and Services
    • Programming
    • System Administration
    • Technologies
    • Thoughts
  • About
  • CV
  • Contact
Menu

Programming

How to escape parenthesis/brackets ‘{‘, ‘}’ in string.Format?

May 16, 2014 No Comments

Usually you have something like this:

string.Format("Output: {0}", "A");

This will result as:

Output: A

What you should do if you want to make an output like this?

Output: {A}

You need to escape parenthesis/brackets like this:

  • You use {{ to output {
  • You use }} to output }

So, you final C# command should look like this:

string.Format("Output: {{{0}}}", "A");

Continue Reading

Categories

  • Banking (2)
  • Branding (1)
  • Company stuff (5)
  • Databases (12)
  • Decisions (6)
  • Design (1)
  • Learning (11)
  • Leisure and Pleasure (13)
  • Marketing (2)
  • Products and Services (6)
  • Programming (11)
  • System Administration (20)
  • Systems (2)
  • Technologies (12)
  • Thoughts (18)
  • Uncategorized (6)
  • CV
  • Posts
  • About
  • Contact

Solving tech problems

Close Menu