title: Razor CSHTML IF statement
body: <p>Anyone here that can help me? I have the following code:</p>
  
  <pre><code>@inherits umbraco.MacroEngines.DynamicNodeContext
  @{ 
      var node = @Model.NodeById(1257);
  }
      &lt;div class="Top10"&gt; 
      &lt;h1&gt;Newest&lt;/h1&gt;
  
  @foreach (var article in node.Descendants().Where("Visible &amp;&amp; (NodeTypeAlias = \"Article\" || NodeTypeAlias = \"sergrein\" || NodeTypeAlias = \"solomyndagrein\")").OrderBy("createDate desc").Take(10))
      {                   
           &lt;a href="@article.Url"&gt;&lt;h2&gt;@article.createDate.ToString("dd/MM") | @article.title&lt;/h2&gt;&lt;/a&gt;    
      }
  
      &lt;/div&gt;
  </code></pre>
  
  <p>What I want is: if @article.title is longer than e.g. 10 characters, it needs to return the 10 characters followed by ... (for example: "this_is_a_..."). If the @article.title is shorter than 10 characters, it can just show the full title length.
  How can this truncating be done?</p>