title: Substring to truncate text?
body: <p>I'm trying to figure out how to truncate the first paragraph, and I've tried:</p>
  
  <pre><code>$div.children( ('p:eq(0)').substring(0,100)); 
  $div.children( ('p:eq(0)'.substring(0,100)));
  </code></pre>
  
  <p>But neither have worked...  </p>
  
  <p>Here's the complete code (which someone here helped me with!) </p>
  
  <pre><code>$j('#hp-featured-item &gt; div[id^="post-"]').each(function() {
          var $div = $j(this),
                  $h2  = $div.find('h2:first'),
                  $obj = $div.find('object, embed, img').filter(':first'),
                  id   = this.id.match(/^post-([0-9]+)$/);
  
          if( $obj.size() &gt; 0){
                  // Find parent
                  var $par = $obj.closest('p');
  
  
                  // Move to top of div
                  $obj.prependTo($div);
  
                  // Remove the now empty parent
                  $par.remove();
  
                  if( $obj.is('img')){
                          // You can't wrap objects and embeds with links, so make sure we just wrap images
                          $obj.wrap( $j('&lt;a&gt;&lt;/a&gt;').attr('href', '/blog/?p='+id[1]));
                  }
          }
  
          // Wrap the contents of the h2, not the h2 itself, with a link
          $h2.wrapInner( $j('&lt;a&gt;&lt;/a&gt;').attr('href', '/blog/?p='+id[1]) );
          $div.children( ('p:eq(0)').substring(0,100));
          $div.children('p:gt(0)').remove();
  
  });
  </code></pre>