---
title: "When we use curly braces in the string.Format its not working in C#?"  
description: "When we use curly braces in the string.Format its not working in C#?"  
author: "Tarun Gautam"  
published: 2017-12-20  
updated: 2017-12-20  
canonical: https://answers.mindstick.com/qa/31876/when-we-use-curly-braces-in-the-string-format-its-not-working-in-c-sharp  
category: "programming"  
tags: ["c#", "asp.net mvc"]  
reading_time: 1 minute  

---

# When we use curly braces in the string.Format its not working in C#?

When we use curly braces in the [string.Format](https://www.mindstick.com/forum/1763/string-format-with-null-values-c-sharp) its not working in C#?

below is my code:

```
string functionName="Add";
string.Format("function {0}(args) { return false; }", functionName);
```

Please help me!.

## Answers

### Answer by Pawan Shukla

Hi Tarun,

I just want to let you know that you are doing simple mistake as you are applying "{return false;}" but actually you should apply "{{ return fasle ;}}". it will definitely work!!.

```
string functionName="Add";
string.Format("function {0}(args) {{ return false; }}", functionName);
```


---

Original Source: https://answers.mindstick.com/qa/31876/when-we-use-curly-braces-in-the-string-format-its-not-working-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
