I need to pad IP addresses with Zeroes for each octet
- by Felipe Alvarez
Starting with a string of an unspecified length, I need to make it exactly 43 characters long (front-padded with zeroes). It is going to contain IP addresses and port numbers. Something like:
### BEFORE
# Unfortunately includes ':' colon
66.35.205.123.80-137.30.123.78.52172:
### AFTER
# Colon removed.
# Digits padded to three (3) and five (5)
#…