0
이 코드를 사용하여 richtextbox에서 줄을 하나씩 지우지 만 빈 줄 (공백)은 남겨 둡니다.Richtextbox에서 줄을 하나씩 제거하는 방법 C#
var text = "";//Holds the text of current line being looped.
var startindex = 0;//The position where selection starts.
var endindex = 0;//The length of selection.
for (int i = 0; i < richtextbox1.Lines.Length; i++)//Loops through each line of text in RichTextBox
{
text = richtextbox1.Lines[i]; //Stores current line of text.
startindex = richtextbox1.GetFirstCharIndexFromLine(i);
endindex = text.Length;
richtextbox1.Select(startindex, endindex);
MessageBox.Show(richtextbox1.SelectedText);
richtextbox1.SelectedText = "";
}
빈 줄 (공백)없이 하나씩 줄을 어떻게 지울 수 있습니까?
샘플 출력과 동일한 샘플 입력을 제공 할 수 있습니까? 나는 네가 무엇을 요구하는지 확신하지 못한다. – KSib
@KSib 샘플 입력 : email1dotcom email2dotcom email3dotcom 샘플 출력 : 이 (공간) (공간) (공간) –
아, 내가 지금 무슨 말을하는지 참조하십시오. 신경 쓰지 마. – KSib