title: How to calculate the number of characters on a line in Vimscript?
body: <p>I need an attribute or function in Vimscript that does a certain task if the current line contains a certain number of characters. For instance:</p>
  <pre><code>if ‹chars_on_current_line› = 50  &quot; for example
      ... perform task ...
  endif
  </code></pre>
  <p>What can I use for the <code>‹chars_on_current_line›</code> subexpression in Vimscript to get the length of the cursor line in characters?</p>
  <p>(If it happens to help in any way, I'm using Macvim.)</p>