title: Emoticons MVC 5
body: <p>While making my project I stuck on a problem. </p>
  
  <p>I have the following thing:
  This is in my PostComment action</p>
  
  <pre><code>comment = Emoticon.Format(comment);
  </code></pre>
  
  <p>Emoticon is public class.
  The Format action return the following:</p>
  
  <pre><code>public static string Format(string input)
      {
          if (input == null || input.Length == 0)
          {
              return input;
          }
          else
          {
              string result = input;
  
              Emoticon[] all = All;
              foreach (Emoticon emoticon in all)
              {
                  string a;
                  string a_;
                  int border;
  
                  // Decide whether a link is required.
                  if (emoticon.Url != null &amp;&amp; emoticon.Url.Length &gt; 0)
                  {
                      a = string.Format("&lt;a href=\"{0}\"&gt;", emoticon.Url);
                      a_ = "&lt;/a&gt;";
                      border = 1;
                  }
                  else
                  {
                      a = "";
                      a_ = "";
                      border = 0;
                  }
  
                  // Replace this emoticon.
                  string replacement =
                      string.Format(
                      "{0}&lt;img src=\"{1}\" alt=\"{2}\" align=\"AbsMiddle\" border=\"{3}\" /&gt;{4}",
                      a,
                      emoticon.VirtualPath,
                      HttpUtility.HtmlEncode(emoticon.Title),
                      border,
                      a_);
  
                  result = result.Replace(emoticon.Shortcut, replacement);
              }
  
              return result;
          }
      }
  </code></pre>
  
  <p>And from PostComment action I go to view and print the comment:</p>
  
  <pre><code>&lt;div class="panel-body"&gt;@comment.Content&lt;/div&gt;
  </code></pre>
  
  <p>But my problem is in <code>string.Format(
  "{0}&lt;img src=\"{1}\" alt=\"{2}\" align=\"AbsMiddle\" border=\"{3}\" /&gt;{4}",</code> because it returns string and in the view it is a string but my purpose is to be a picture. <code>@comment.Comment</code> is also string.</p>