我想从文本框(txtFrom)中获取一个字符串,并将第一个单词保存下来,将剩下的内容保存到另一个部分中。(剩余的内容是第一个空格后的所有内容)
例如字符串 =“Bob jones went to the store”
array [0] 将给出 “Bob” array [1] 将给出 “jones went to the store”
我知道可以使用
例如字符串 =“Bob jones went to the store”
array [0] 将给出 “Bob” array [1] 将给出 “jones went to the store”
我知道可以使用
string[] array = txtFrom.Split(' ');
,但这会给我一个包含每个单词的长度为6的数组。