How to extract the first name in the name

Hi Team,

I have a string format “Last name,First name”.I want only first name.So with the first name i will be sending email .

Example:“Bangaru,Krishna” output:Krishna …which means i want only the second string.

Can you please help me here

Thanks

Hi.

If it’s always separated by a comma, I can suggest simply using the .Split() function using the “,” character, then take the second item.

Example:

text.Split(","c)(1).Trim

“c” means character because you can only split by a character or character array. (1) is used to take the second item after the split.

Regards.

2 Likes