dreimer Posted July 6, 2012 Share Posted July 6, 2012 So I have a 30 character string and I want to ignore part of it and then add spaces to what is left, for example string: 123456789012345678901234567890 I want to read trimming of the first eight characters: 9012 3456 7890 1234 5678 90 Can anyone help me out with a rule to get this done? Thanks in advance. Link to comment Share on other sites More sharing options...
Dan Korn Posted July 6, 2012 Share Posted July 6, 2012 return Field("FieldName").substr(8).replace(/(\d{4})/g, '$1 '); I found the last bit by Googling "JavaScript insert space every four". You're not the only one trying to generate postal barcodes in JavaScript. Link to comment Share on other sites More sharing options...
dreimer Posted July 6, 2012 Author Share Posted July 6, 2012 No idea what all the script means, but it worked!! Thank You Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.