-1

enter image description here

I am using Scintilla control in my WPF application. When i open the application and type something in the Scintilla control, then copy some text from the control (without saving it in an object), and paste it in Notepad, it is working fine.

Eg: I am typing the text:

Hi,
This Is Nirbhay.
Trying To copy paste.

and after copying it and pasting in Notepad, the text is the same.

And when I save it in an object and try to reopen it in the editor, it's also shown the same. But when I then copy and paste that in Notepad, it is shown like this:

Hi,This Is Nirbhay.Trying To copy paste.

Can anyone please help me in solving this issue.

0

1 Answer 1

0

I have fixed this issue by replacing the '\n' character with '\r\n'. Code snippet is:

public string Script { get { return SpecificBlock.Script.Replace("\r", "").Replace("\n", "\r\n"); } }

in first step i replaced '\r' character with empty char and then replaced '\n' char with '\r\n'. I did this becouse if there is any '\r\n' the it will be safer that remove all '\r', becouse i am going to insert '\r' with all '\n'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.