I have a need to process a postcode value passed to a form. The postcode should be in two parts, the first being the "region" and the second the precise location, e.g. B97 5UX. I am checking that a space exists, in order to identify where the first part of the postcode ends. My problem however is to separate out the alphabetic first 1-2 characters, and then the 1-2 numerics that follow, as these two parts are used to locate a match in another table.
The first part of the postcode could be (if legitimate) between 2 and 4 characters, and I could use tedious coding to do this job, but am looking for something more elegant.
Any ideas?
The first part of the postcode could be (if legitimate) between 2 and 4 characters, and I could use tedious coding to do this job, but am looking for something more elegant.
Any ideas?