Strip Dashes and Spaces from Credit Card

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Strip Dashes and Spaces from Credit Card

    Hi,

    Does anyone know an easy way to strip dashes and spaces (or any other
    characters for that matter) from a credit card.
    I want to allow users to enter their credit card in any manner that they
    choose and then store just the numbers in the DB.

    Thanks,
    Steve

    slanza Guest

  2. Similar Questions and Discussions

    1. Credit Card Validation
      Does any one know how to check the algorithm of the credit card number that was entered in the text box? I want to be able to make sure the users...
    2. Display Credit Card number with dynamic Dashes
      Hi, I record Credit card numbers without the dashes in them but want to display them with the dashes. is a loop needed for this? where can I find how...
    3. function to strip spaces?
      On 05 Aug 2003, "Jason Wolfe" <jason@infuselabs.com> wrote: Director doesn't have a built in method for this. Here's one way: on trim aString...
    4. [PHP] Credit card/Debit card validation
      I have a mod10 validation script written in another scripting language. I could try to convert it if you would like but I am sure that someone has...
    5. Credit card/Debit card validation
      Does anyone know of a PHP routine to validate Credit/Debit cards? I've seen some convoluted Javascript scripts but want a PHP version so validation...
  3. #2

    Default Re: Strip Dashes and Spaces from Credit Card

    slanza,

    Try this:

    #ReReplace( credit_card_nbr, "[^1-9]", "", "ALL" )#

    RegularExpression Replacement is a good call, as you define to remove ANY non-numeric character from your string!
    moneybagsxp Guest

  4. #3

    Default Re: Strip Dashes and Spaces from Credit Card

    Thanks so much! That code works great.
    slanza Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139