开发者

select multiple ranges of text in text box silverlight

开发者 https://www.devze.com 2023-03-02 03:31 出处:网络
I have a text box control and I want to select a multiple ranges of text when i click on button. for example:

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'.

0

精彩评论

暂无评论...
验证码 换一张
取 消