문제

I'm trying split some text typed into a text edit control into individual words to put them in an array.......any newline characters should be put into an array as well. The problem is I'm having trouble detecting newline characters along the way...

What is the correct way to do this?

I've tried the following:

for(int i = 0; i < text.GetLength(); i++)
{
    m_RichEditor.SetSel(0 + i, i + 2); //from start to end character
    m_RichEditor.GetSelectionCharFormat(cf);


    if(m_RichEditor.GetSelText() == "\n") {
        OutputDebugString((CString)"here");
    }

}

but this doesn't work....

도움이 되었습니까?

해결책

It seems, for RichEdit 2.0, the character for newline is not "\n"....it is "\r"!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top