Hi,
I have a string with undefined number of words.
I want to split this string in two parts: the last word alone and all the other words in another string.
How is that possible?
Thank you in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satya KarkiPosted Nov 20, 2021, 3:05 PM
Rijwan AnsariPosted Nov 20, 2021, 3:00 PM
Rijwan AnsariPosted Nov 20, 2021, 2:59 PM
Pankajkumar PatelPosted Nov 20, 2021, 10:54 AM
DarilPosted Nov 19, 2021, 7:49 AM
Use Split to split string on spaces.
By doing so it will separate all the words in it.
The output will be
You can also use String.Substring() and String.LastIndexof() instead of .Split
SenthilkumarPosted Apr 4, 2012, 11:27 AM
Simple logic will help you to get easily..
If it is helpful then mark it as correct answer.
VulpesPosted Apr 4, 2012, 9:28 AM