I am scraping a customer name as part of a data table from a website for a bot that I am building and then use string manipulation to get the first and last name. This worked at first, but the bot fails if there is a middle name. For example:
The website field is called ‘name’ and will state the customer’s name as ‘Joe Blogs’ and so I used this code:
pDictionary(“Name:”).Trim.Split(" “c)(0) - First name
pDictionary(“Name:”).Trim.Split(” "c)(1) - Second name
I then use and assign activity to turn the above code into a variable of FirstName or SecondName.
The issue is, if the customer name is ‘Joe S Blogs’ or ‘Joe Steven Blogs’ then the second name of course lists the second name as ‘S/Steven’ rather than ‘Blogs’.
How would I make it so that the bot can tell if there is a middle name and has to exclude it? Customer details of course change on a case-by-case basis.
Apologies, I’m still new to this!