Extract each words after a space

Hello everyone,

I would like to extract each word in the sentence occurring after the blank space.

Example sentence :
" Hello everyone, this is a pleasant afternoon"

Regards
Pranav Sundar

@Pranav_Sundar

words = sentence.Split(" "c)

words–>string
Use For each loop to iterate

Hi @Pranav_Sundar

Try this

remainingWords = String.Join(" ", sentence.Split(" "c).Skip(1))

Regards

Hi @Pranav_Sundar

Try this syntax:

sentence = " Hello everyone, this is a pleasant afternoon"
wordsArray = sentence.Split(" "c).Skip(1).ToArray()

image

sentence = " Hello everyone, this is a pleasant afternoon"
wordsArray = String.Join(Environment.NewLine, sentenceSplit(" "c).Skip(1))

image

Hope it helps!!

Hi @Pranav_Sundar

You can use the Split function to split the each word with space. Use the below linq expression to extract each word after space and store in a List of String datatype variable called List_Items.

- Assign -> Input = " Hello everyone, this is a pleasant afternoon"

- Assign -> List_Items = Input.Split(" "c).Where(Function(X) Not(String.IsNullOrEmpty(X) Or String.IsNullOrWhiteSpace(X))).ToList()

Then use for each activity to iterate the each item in the List_Items variable.

Check the below workflow for better understanding,

Hope it helps!!

Thank you everyone for the solution.

Regards
Pranav Sundar

1 Like

@Pranav_Sundar
Kindly mark as solution so the loop closes

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