detecting "\r\n" C++/CLI
Jul 2, 2011 at 1:11am
I'm trying to create a program similar to notepad++ (not publishing, just wanting to learn)
problem is... I don't know how to detect when the user presses 'ENTER' or 'RETURN' to create a new line. Any ideas?
Example:
Hello, My name is theNewGuy
How are you?
There is a new line made by the 'ENTER' key between "theNewGuy" and "How". How would I detect that for:
1 2 3 4 5 6 7 8 9
|
System::String^ newLineStart;
if (NEW LINE DOES EXIST)
{
newLineStart = "Yes";
}
else
{
newLineStart = "No";
}
|
Jul 2, 2011 at 1:25am
Never mind, I found the answer. I was trying
if (richTextBox1->Text->Contains ("\r\n")
I didn't know that when testing for new lines you needed to use:
if (richTextBox1->Text->Contains ("\n"))
Thanks anyway!
Topic archived. No new replies allowed.