Check for consecutive values in array and copy

I am trying to figure out how to check an array for consecutive numbers and then copy the ones that arent consecutive to a new array. To make things a little more difficult the keys arent strictly numbered there are letters in front of them. Any ideas?

var1 = array(“PK100”,“PK101”,“PK102”,“PK110”,“PK120”)

should be separated into

var2 = array(“PK100”,“PK101”,“PK102”)
var3 = array(“PK110”,“PK120”)

or

var2 = array(“PK100”,“PK101”,“PK102”)
var3 = array(“PK110”)
var4 = array(“PK120”)

Sponsor our Newsletter | Privacy Policy | Terms of Service