title: Javascript: How to remove characters from end of string?
body: <p>I have a string <code>"foo_bar"</code> and <code>"foo_foo_bar"</code>. How do I remove the last <code>"_bar"</code> from the string? So I'm left with "foo" and <code>"foo_foo"</code>.</p>