title: How can I split a textstring using razor (in Umbraco)?
body: <p>I'm relatively (more like completely) new to the world of razor, and have inevitably hit my first hurdle. I'm a web developer who is also new to the CMS Umbraco, and therefore I've been working with razor for scripting. </p>
  
  <p>My problem is rather a simple one I believe; how can I split a textstring to display 4 different words/values, with commas in between? </p>
  
  <p>Ideally, I would like to turn something like:</p>
  
  <p>"WhyWontThisWork" into "Why, Wont, This, Work" and to possibly complicate things: "'Why', Wont, This, Work" (with the 's around the first word)</p>
  
  <p>I"ve been trying with this method from another thread, but to no avail:</p>
  
  <pre><code>@foreach (string s in "1,2,3".Split(',')) {
    @: s is equal to @s&lt;br/&gt;
  }
  </code></pre>
  
  <p>By trying to implement this syntax into my own script, it looks like the following, and therefore it doesn't work:</p>
  
  <pre><code>@inherits umbraco.MacroEngines.DynamicNodeContext
  @{
      foreach (var x in Model.uctextstring.Split(',')) {
          @x.InnerText
      }
  }
  </code></pre>