how can I delete the last remaining word within a string in a textbox like this;
Values in textbox1: "this is my first time of learning c#"
I have been able to delete each word from the left until the last remaining word which is "C#" using this code;
string word = textbox1.Text; if (word.Length > 0) { int k = word.IndexOf(" ") + 1; string ster = word.Substring(k); textbox1.Text = ster; } But I don't know how to delete the remaining word "C#" from the textbox1.
https://stackoverflow.com/questions/66683696/how-to-delete-the-remaining-last-word-within-a-string-in-a-textbox1 March 18, 2021 at 09:52AM
没有评论:
发表评论