Answers.Body: <p>There is a small difference, single-quoted strings don't support interpolation:</p>
  
  <pre><code>{% set string = 'There is a #{car}.' %}
  </code></pre>
  
  <p>The above example <strong>won't</strong> work. If you want to use it, you need to wrap your string in double quotes:</p>
  
  <pre><code>{% set string = "There is a #{car}." %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-25T15:06:08.840Z
Answers.Text: @Bryan `{{ 'test' ~ 'String' }}` works for me.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-25T15:14:48.627Z
Answers.Text: @ChristianSeelbach Yep. You're right. I misread the Twig docs.
Answers.UserDisplayName: Bryan Redeagle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-16T22:16:13.100Z
Answers.Text: This is similar to the PHP logic between single and double quotes.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-17T11:22:58.837Z
Answers.Text: Except that you can concatenate string in PHP using single quotes (using "."). Twig still requires double quotes (using "~").
Answers.UserDisplayName: Bryan Redeagle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-16T21:25:53.340Z
Answers.LastActivityDate: 2014-06-17T09:50:36.137Z
Answers.LastEditDate: 2014-06-17T09:50:36.137Z
Answers.UserDisplayName: nicael
Body: <p>Is there a difference between using single-quoted and double-quoted strings?</p>
  
Tags: <templating><string><difference>
Title: What's the difference between using single and double quotes in strings?
ThreadText: # What's the difference between using single and double quotes in strings?
  
  (Asked by: username_0 on 2014-06-16)
  
  Is there a difference between using single-quoted and double-quoted strings?
  
  **Tags:** templating, string, difference
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-06-16. Score: 18 | Accepted answer
  
  There is a small difference, single-quoted strings don't support interpolation:
  
  ```
  {% set string = 'There is a #{car}.' %}
  
  ```
  
  The above example **won't** work. If you want to use it, you need to wrap your string in double quotes:
  
  ```
  {% set string = "There is a #{car}." %}
  
  ```
  
  > **Comments:**
  > **username_3**: This is similar to the PHP logic between single and double quotes.  
  > **username_2**: Except that you can concatenate string in PHP using single quotes (using "."). Twig still requires double quotes (using "~").  
  > **username_1**: @username_2 `{{ 'test' ~ 'String' }}` works for me.  
  > **username_2**: @ChristianSeelbach Yep. You're right. I misread the Twig docs.  
  
  ---
  
  