Re: javascript help (UNCLASSIFIED)

From: Mark Pernotto <mark.pernotto_at_nyob>
Date: Thu, 18 Jan 2018 08:51:46 -0800
To: CODE4LIB_at_LISTS.CLIR.ORG
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) <
kaile.zhu.naf_at_mail.mil> 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
>
Received on Thu Jan 18 2018 - 11:52:50 EST