title: How to only show few characters when pasting text in editor?
body: <p>trying to <strong>paste</strong> characters and if it is more than 50 characters <strong>ONLY show the first 50 characters</strong>. Can anyone tell me what I'm missing?</p>
  
  <p>Here's my code: <a href="http://jsfiddle.net/henryDev/2ftroyuv/2/" rel="nofollow noreferrer"><strong>LIVE DEMO</strong></a></p>
  
  <pre><code>CKEDITOR.instances.foo.on('paste',function(event){
  
      alert('paste');
      var deleteKey = 46;
      var backspaceKey = 8;
      var keyCode = event.data.keyCode;
      if (keyCode === deleteKey || keyCode === backspaceKey)
          return true;
      else
      {
          var textLimit = 50;
          var str = CKEDITOR.instances.foo.getData();
          if (str.length &gt;= textLimit)
          // Need to add code here to only show the first 50 characters
              return false;
      }
  });
  </code></pre>