0
* 強大的文本我有一個RichTextBox,喜歡尋找一句話,與世界你好開始,蘊含「這裏的」行。並結束於;半列比我喜歡只刪除「HERE」。 。我的句子,下面的例子只是句子的一行,而句子可能是2行,所以條件應該以Hello Worlds開頭並以;半列比刪除 「這裏」 *從richtextbox中移除單詞的最佳方式是什麼?
我的一句話的行:
Hello Worlds the weather is too hot "HERE"."IN" CANADA!;
我的兩行句子可能是這樣的:
Hello Worlds the weather is too hot "HERE"."IN" CANADA!. But we are still like it;
結果應該是一行:
Hello Worlds the weather is too hot "IN" CANADA!;
結果應該是2線:
Hello Worlds the weather is too hot "IN" CANADA!. But we are still like it;
好,我停留在我的代碼:
List<string> rt = new List<string>();
foreach (string line in richTextBox1.Lines)
{
if (line.StartsWith("Hello Worlds") && line.Contains("HERE"))
{
//remove "HERE".
}
}
錯誤無法從「字符串」到「廉政」轉換。它看起來像string.Remove(int) – user2661591
我喜歡刪除「HERE」。 – user2661591
更新........ – Ehsan