I have a text string that contains several sets of letters, I need to extract the word with 12 characters (the Mac Address) and store the rest in another variable, regardless of its position.
string x = "AXIS CAMERA - ACCC8E533101 HOSTNAME Layer 2";
When I refer to not having to do with its position, I mean that the code can extract it regardless of whether it is the first, second or third, as in these cases:
string x1 = "ACCC8E533101 - AXIS CAMERA HOSTNAME Layer 2";
string x2 = "AXIS ACCC8E533101 CAMERA Layer 2 HOSTNAME";
string x3 = " AXIS CAMERA ACCC8E533101 HOSTNAME Layer 2";
Just a simple function:
It will return the first text string with 12 characters or empty text if not found.