从替换同一个 ListBox 的文本的 ListBox 中提取部分字符串

Extract partial strings from a ListBox that replace the text of the same ListBox

我的代码需要帮助。
我有一个 ListBox,其中包含这样的文本行:

"hello my friends, how r u?","today is good","hey"
"I'm fine","and you","doing"
"have a nice day","thanks","man"

我想使用 SubString()(或其他方法,这无关紧要)删除此 ListBox 项目的子字符串。
当我编译我的代码时,我想在我的 ListBox(相同的 ListBox,而不是新的)中看到这个输出。

hello my friends, how r u?
I'm fine
have a nice day

注意:我想分享我的代码,但我无法生成任何代码,抱歉。

迭代 ListBox Items 集合,拆分结果字符串并只取第一个元素,最后修剪现在无用的引号。

for (int item = 0; item < listBox1.Items.Count; item++)
{
    listBox1.Items[item] = listBox1.Items[item].ToString()
            .Split(new[] { "\",\"" }, StringSplitOptions.None)[0].TrimStart('"');
}

或者像这样:

int i = -1;
listBox1.Items.OfType<string>().ToList().ForEach((s) => {
    listBox1.Items[++i] = s.Split(new[] { "\",\"" }, StringSplitOptions.None)[0].TrimStart('"');
});