<p>The <a href="http://twig.sensiolabs.org/doc/filters/upper.html">upper filter</a> is what you are looking for:</p>

<pre><code>{% set var = 'Hello World' %}

{# Print in UPPERCASE #}
{{ var|upper }} {# 'HELLO WORLD' #}
</code></pre>

<p>Besides <a href="http://twig.sensiolabs.org/doc/filters/upper.html">upper</a> there are also some other filters available to modify the capitalization style of your strings. Of course there is the lowercase equivalent <a href="http://twig.sensiolabs.org/doc/filters/lower.html">lower</a> and additionally there are some Craft exclusive <a href="http://buildwithcraft.com/docs/templating/filters">filters</a> available.</p>

<pre><code>&lt;ul&gt;
  {# Set test strings #}
  {% set strLower = 'this is a test string' %}
  {% set strUpper = 'THIS IS A TEST STRING' %}
  {% set strMixed = 'this Is a TEST stRing' %}

  {# Apply Twig filters #}
  &lt;li&gt;upper: {{ strLower|upper }}&lt;/li&gt; {# 'THIS IS A TEST STRING' #}
  &lt;li&gt;lower: {{ strUpper|lower }}&lt;/li&gt; {# 'this is a test string' #}

  {# Apply filters provided by Craft #}
  &lt;li&gt;ucwords: {{ strLower|ucwords }}&lt;/li&gt; {# 'This Is A Test String' #}
  &lt;li&gt;ucfirst: {{ strLower|ucfirst }}&lt;/li&gt; {# 'This is a test string' #}
  &lt;li&gt;lcfirst: {{ strUpper|lcfirst }}&lt;/li&gt; {# 'tHIS IS A TEST STRING' #}      

  {# Combine filters for predictable application #}
  &lt;li&gt;ucwords: {{ strMixed|lower|ucwords }}&lt;/li&gt; {# 'This Is A Test String' #}
  &lt;li&gt;ucfirst: {{ strMixed|lower|ucfirst }}&lt;/li&gt; {# 'This is a test string' #}
  &lt;li&gt;lcfirst: {{ strMixed|upper|lcfirst }}&lt;/li&gt; {# 'tHIS IS A TEST STRING' #}

  {# Examples for possible use cases #}
  &lt;li&gt;PascalCase: {{ strMixed|lower|ucwords|replace(' ', '') }}&lt;/li&gt; {# 'ThisIsATestString' #}
  &lt;li&gt;camelCase: {{ strMixed|lower|ucwords|lcfirst|replace(' ', '') }}&lt;/li&gt; {# 'thisIsATestString' #}
&lt;/ul&gt;
</code></pre>

CC BY-SA 3.0
2014-06-14T13:52:57.463Z
Sorry Victor, actually I wanted to make this edit only a proposal. Don't know why it applied directly!? SE is soooo new to me! You can revert this and I add an additional answer, if you want.
carlcs
CC BY-SA 3.0
2014-06-14T13:55:04.133Z
Over 500reps SE allows you to edit directly, and why should somebody have something against it? ;)
Victor
CC BY-SA 3.0
2014-06-14T13:57:18.880Z
So there no way to just suggest changes if you have this "privilege"? Don't like that actually.
carlcs
CC BY-SA 3.0
2014-06-14T13:58:39.163Z
I don't think so, but I'm also pretty new to this.
Victor
CC BY-SA 3.0
2014-06-14T14:23:02.013Z
@ChristianSeelbach No, there is no way. Also, you now can review the edits, suggested by "small" users. You earn this privilege at 500 reputation points in private betas, at 1,000 reputation points in public betas and at 2,000 reputation points in completely launched sites.
nicael
CC BY-SA 3.0
2014-06-14T09:55:19.380Z
2014-06-14T14:15:04.023Z
2014-06-14T14:15:04.023Z
Victor
<p>Is it possible to convert a simple string ("Hello World!") to uppercase ("HELLO WORLD!")?</p>

<string><uppercase>
Is it possible to convert string to uppercase?
# Is it possible to convert string to uppercase?

(Asked by: username_0 on 2014-06-14)

Is it possible to convert a simple string ("Hello World!") to uppercase ("HELLO WORLD!")?

**Tags:** string, uppercase

---

## 1 answers

### Answer by username_1 on 2014-06-14. Score: 15 | Accepted answer

The upper filter is what you are looking for:
{% set var = 'Hello World' %}

{# Print in UPPERCASE #}
{{ var|upper }} {# 'HELLO WORLD' #}

Besides upper there are also some other filters available to modify the capitalization style of your strings. Of course there is the lowercase equivalent lower and additionally there are some Craft exclusive filters available.

  {# Set test strings #}
  {% set strLower = 'this is a test string' %}
  {% set strUpper = 'THIS IS A TEST STRING' %}
  {% set strMixed = 'this Is a TEST stRing' %}

  {# Apply Twig filters #}
  upper: {{ strLower|upper }} {# 'THIS IS A TEST STRING' #}
  lower: {{ strUpper|lower }} {# 'this is a test string' #}

  {# Apply filters provided by Craft #}
  ucwords: {{ strLower|ucwords }} {# 'This Is A Test String' #}
  ucfirst: {{ strLower|ucfirst }} {# 'This is a test string' #}
  lcfirst: {{ strUpper|lcfirst }} {# 'tHIS IS A TEST STRING' #}      

  {# Combine filters for predictable application #}
  ucwords: {{ strMixed|lower|ucwords }} {# 'This Is A Test String' #}
  ucfirst: {{ strMixed|lower|ucfirst }} {# 'This is a test string' #}
  lcfirst: {{ strMixed|upper|lcfirst }} {# 'tHIS IS A TEST STRING' #}

  {# Examples for possible use cases #}
  PascalCase: {{ strMixed|lower|ucwords|replace(' ', '') }} {# 'ThisIsATestString' #}
  camelCase: {{ strMixed|lower|ucwords|lcfirst|replace(' ', '') }} {# 'thisIsATestString' #}

> **Comments:**
> **username_2**: Sorry Victor, actually I wanted to make this edit only a proposal. Don't know why it applied directly!? SE is soooo new to me! You can revert this and I add an additional answer, if you want.  
> **username_1**: Over 500reps SE allows you to edit directly, and why should somebody have something against it? ;)  
> **username_2**: So there no way to just suggest changes if you have this "privilege"? Don't like that actually.  
> **username_1**: I don't think so, but I'm also pretty new to this.  
> **username_0**: @ChristianSeelbach No, there is no way. Also, you now can review the edits, suggested by "small" users. You earn this privilege at 500 reputation points in private betas, at 1,000 reputation points in public betas and at 2,000 reputation points in completely launched sites.  

---

