Get 6 word in string

hi all

I have a variables as string. After get text in my variable. I would like to type into this text but I just want to type first 6 words. so How can I do that. my string: variables.Replace(“Sponsored Ad -”, “”).Replace(“-”,“”) .Replace(“,”, “”).(what I need to write it???)

thanks for help

for example: this is my sentences : Joosen Safe Box,0.8 Cubic Feet Gun Money Pistols Handgun Document Personal Screct

I want to get this as: Joosen Safe Box 0.8 Cubic Feet Gun Money Pistols

@beginnerui
Welcome to the forum

Maybe you can provide us a sample text and tell us based on this which shortened text you would like to extract. Thanks

for example: this is my sentences : Joosen Safe Box,0.8 Cubic Feet Gun Money Pistols Handgun Document Personal Screct

I want to get this as: Joosen Safe Box 0.8 Cubic Feet Gun Money Pistols

this is example

thanks for help


String.Join(" ",YourStringVar.Replace(",", " ").Split(" "c).Take(8))

Hi Peter. I dont know how many times thank you. You save my tons of time. Finally wroking. thank you sssssooooooooooo muuuucccchhh.

best regards

1 Like

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