title: How do I remove last few characters from a string in C
body: <p>I know I can use <code>substr()</code> to have the first <code>n</code> number of characters from a string. However, i want to remove the last few character. Is it valid to use <code>-2</code> or <code>-3</code> as the end position in C like the way I can do it in Python?</p>