select multiple ranges of text in text box silverlight
I have a text box control and I want to select a multiple ranges of text when i click on button. for example: the text is :"I want to select" and I want that the selected words will be "want"开发者_开发百科 and "select".
do you have an idea of how to implement this?
thanks,pavel.
Not sure if this is what you're looking for but:
var words = textBox1.Trim().Split(' ');
Then you have an array of strings of all words. . Trim() ensures that you don't have any spaces in front or after the 'sentence'.
精彩评论