我有一个字符串,我不知道它的项目数.我想将这个字符串数组拆分成一个新数组.之后,我需要删除重复的项目,如下例所示.
例如,在下面:单词"hi"和"friends"两次,但我们在第二个数组中写入一次,它不一定是两次,有时是3次或更多,单词"hi"和"朋友"只是例如,也许其他的话去两次或更多次).
例如;
string[] myString = {"hello friends", "hi guys", "hi friends", "how are", "123654 u?", "today man", "! ?", "maybe tomorrow", "5 2-", "99 1585126", "(/&&/& _____"};
Run Code Online (Sandbox Code Playgroud)
我想将它拆分成一个新的字符串数组(根据空间特征);
string[] new = {"hello", "friends", "hi", "guys", "how", "are", "123654", "u?", "today", "man", "!", "?", "maybe", "tomorrow","5" ,"2-" ,"99", "1585126", "/&&/&", "_____"} ;
Run Code Online (Sandbox Code Playgroud)