Without any more information, you could do something along these lines:
var string = '99999-0123';
var newstring = string.slice(0,-5);
But that won't take into account if the first 5 numbers are, in fact,
numeric. Should the numeric check occur prior to the string slicing?
Mark
On Thu, Jan 18, 2018 at 8:47 AM, Zhu, Kaile NAF USARMY IMCOM HQ (US) <
[log in to unmask]> wrote:
> CLASSIFICATION: UNCLASSIFIED
>
> Anybody can help me with such JavaScript code that can chop the ending
> portion of the string - last 5 characters - verifying if it is all numbers
> (zip code)?
>
> Thanks.
>
> Kelly Zhu
>
> CLASSIFICATION: UNCLASSIFIED
>
|