title: Problem with Substring() - ArgumentOutOfRangeException
body: <p>I have a repeater that displays data from my Projects table. There are projectId, name and description. I use Substring(1, 240) on description. But sometimes the string is shorter than 240, so I get ArgumentOutOfRangeException. Can you tell me how to display the whole text if I get the exception. This is my code.</p>
  
  <pre><code>    &lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
  &lt;asp:Panel ID="pnlDisplayProjects" runat="server" Visible="true"&gt;
      &lt;center&gt;&lt;h2&gt;&lt;b&gt;Проекти&lt;/b&gt;&lt;/h2&gt;&lt;/center&gt;
          &lt;asp:Repeater ID="rptrProjects" runat="server"&gt;
              &lt;HeaderTemplate&gt;
                  &lt;table border="1" cellpadding="2" cellspacing="2" align="center" width="80%" style="background-color:#F7F6F3;"&gt;
              &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;tr&gt;
                      &lt;td align="left" style="width:40px"&gt;
                          &lt;asp:Label ID="LblProjectId" runat="server" Text='&lt;%# Eval("ProjectID") %&gt;' /&gt;
                      &lt;/td&gt;
                      &lt;td align="center"&gt;
                          &lt;asp:Label ID="LblName" runat="server" Text='&lt;%# Eval("Name") %&gt;' /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;
                          &lt;asp:Label ID="LblDescription" runat="server" Text='&lt;%# Eval("Description").ToString().Substring(1, 240) + "..." %&gt;'/&gt;
                          &lt;asp:HyperLink ID="HlMore" runat="server" NavigateUrl='&lt;%#"~/Project/ViewProject.aspx?projectId=" + Eval("ProjectID") %&gt;' Text="More" /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/ItemTemplate&gt;
              &lt;FooterTemplate&gt;
                  &lt;/table&gt;
              &lt;/FooterTemplate&gt;
          &lt;/asp:Repeater&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code> protected override void OnPreRender(EventArgs e)
      {
          var table = Projects.GetTableWithProjects();
  
          if (table.Rows.Count &gt; 0)
          {
              rptrProjects.DataSource = table;
              rptrProjects.DataBind();
          }
          else
          {
              pnlDisplayProjects.Visible = false;
              Master.PrintMessage("There are no projects.");
          }
      }
  </code></pre>