开发者

How can i copy contents from 1 string to another...

开发者 https://www.devze.com 2023-03-23 14:28 出处:网络
I am a working on NER (named entity recognition开发者_高级运维) module with using unicode devnagri hindi.

I am a working on NER (named entity recognition开发者_高级运维) module with using unicode devnagri hindi.

I have two string. In the 1st one, we are taking all the contents of text box.

string[] s = richTextBox1.Text;

In the 2nd one, we wanna get sentences by splitting the contents with using "|" of 1st string (string s).

how could we declare 2nd string and how could we copy contents from string s to 2nd string.

Now, help us on this.....


I'll recommend you read up on the basics of strings in C#. And after that, look into what arrays are. Perhaps start out with a good tutorial explaining you all the basics, before you bother with UI controls?


List<string> s = new List<string>;
s.Add(richTextBox1.Text);
s.AddRange(s[0].Split('|');

string[] strings = s.ToArray();

Be careful though, this can end up very costly (both performance and memory wise) if you use it frequently enough (many times a millisecond).


If I read the question right, something like:

string[] sentences = richTextBox1.Text.Split('|');

Say your data in the textbox was a|b|c, then

sentences[0] will be equal to a, sentences[1] equal to b and so on.

0

精彩评论

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