Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Getting Started, Learning, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 5th, 2014, 08:34 AM
dbustin dbustin is offline
Junior Community Member
 
Join Date: Aug 2010
Posts: 10
Default Deleting numbers after a hyphen OR using just the leading 5 numbers

I know I have used a rule like this before, but can't seem to find it. I have a Zip code field that has either 12345 or 12345-2222. I need a rule to delete the numbers after the hyphen or just use the first 5 characters.

Any help? Thanks!
Reply With Quote
  #2  
Old November 5th, 2014, 10:20 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Deleting numbers after a hyphen OR using just the leading 5 numbers

You can use the first 5 characters like so:
Code:
return Left(Field("zip"),5);
You can replace the dash and anything that comes after it:
Code:
return Field("zip").replace(/-.*$/,'');
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.