This repository was archived by the owner on Mar 4, 2025. It is now read-only.
  
  
  - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4
 
addEvery
        elcapo edited this page Nov 4, 2014 
        ·
        3 revisions
      
    addEvery Inserts a given character into a string every n positions.
/* MySQL */
SELECT addEvery( '00000000', '-', 2 ); /* Returns 00-00-00-00 *//* JavaScript (independent function) */
return addEvery( '00000000', '-', 2 ); /* Returns 00-00-00-00 */
/* JavaScript (as a String method) */
return '00000000'.addEvery( '-', 2 ); /* Returns 00-00-00-00 *//* PHP */
return addEvery( '00000000', '-', 2 ); /* Returns 00-00-00-00 */This function is being used by external packages as Fields Good, in order to construct masks that make the user experience more confortable. For instance, its being used to insert a space every four characters when working with IBANs.
This function is part of the [Common functions](Common functions) package.
Go back home!
SEPA validations
- [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))
 
Spanish validations
- NIF, NIE & CIF
 - [Spanish Bank Accounts](Spanish Bank Accounts)
 
Helpers
- [Common functions](Common functions)