Split an array and add it to a string

I have this string
image

It can be of multiple lengths, but I just want to skip the First word and add the remaining to Last Name.

The string can have more than 2 words.
Is there an easier way to do that?
Thanks

Hi @chauhan.rachita30

Try this

lastName = String.Join(" ", inputString.Split(" "c).Skip(1))

Cheers!!

2 Likes

@chauhan.rachita30,

Try this:

strOutput= String.Join(" ",strInput.Split(" ").Skip(1).ToArray())

Thanks,
Ashok :slight_smile:

1 Like

@chauhan.rachita30

Cheers!!

1 Like

Hi,

I have an input string in_strLastName and another one strLastName
image
I want to check that if strLastName contains any of the words from in_strLastName
Contains is returning false:
image

@chauhan.rachita30

Can you try the below

containsWord = strLastName.Split(" "c).Any(Function(word) in_strLastName.Split(" "c).Contains(word))

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.