how do i get string like "aaa-23" from "aaa-23-34" in jquery?
<p>For example-1 : I have string like "aaa-23-34" and I want string from this is "aaa-23"</p>

<p>For example-2 : <code>var str = "aaa-44-34-12"</code></p>

<p>output should be <code>"aaa-44-34"</code></p>

<p>That means I want string before the last hyphen.</p>
