I need to fix invalid zipcodes. The people who exported the data treated the zipcode as numeric and, as a result, the New Jersey and Puerto Rico postal codes, which start with a leading zero and two leading zeros, respectively, were truncated.
They are supposed to be five characters (no data on zip + 4). I know how to use zero-load brute force by getting the length and adding the appropriate number of zeros to the string, but is there a more elegant way that relies on the "native" C # functions? For example, can a mask be applied that turns "9163" into "09163" and "904" into "00904" without my need to get the length of the value?
source share