Hi everyone,
I've got multiple strings that I wish to extract various parts of the string out.
There are multiple cases that need to be considered when doing this as there are no 2 strings from my list of strings that are the same, hence why i need to account for the different possible cases
some examples of Strings:
MyString = "Project1234 -MS- SUBURB street name and details"
or
MyString = "Project1234 -MS- SUBURB NAME street name and details"
or
MyString = "Project1234 -MS- SUBURB id123 details"
or
MyString = "Project1234 -MS- SUBURB ID123 details"
or
MyString = "Project1234 -MS- SUBURB ID123 details"
The information i need:
(from the example above)
Project_ID = "Project1234"
Employee_Initials = "MS"
Suburb = "SUBURB" Or (in the case of a 2 word string for suburb) "SUBURB NAME"
Identifying the suburb is where I need your help.
The suburb always starts after the second dash (-) in MyString.
The suburb always finishes at the first instance of any of the following:
When a string with a number appears (i.e. id123)
When a word that isnt entirely capitals appears (i.e street name/ Street name)
When any type of special character appears (i.e. ~ , . > < # @ $ % ^ & etc)
If you could please provide some assistance that would be greatly appreciated!
Jordan
Bookmarks