How to replace the line breaks with spaces in the recognized text field

Question

Can the excess line breaks in the value of the text field be replaced by spaces or other characters?

Answer

If you have the excess line breaks in the value of the text field, you can easily replace it with spaces or any other symbol.

To do this, open the field Properties and go to the Data tab. Click the Edit... button under the AutoCorrect options:

mceclip2.png

and enable the Use script option:

mceclip3.png

Click the Edit... button to edit the script and add the following strings:

//Autocorrection script
//C# .Net
//Replace the line breaks in the value with spaces
string val = Value.Text;
val = val.Replace("\r\n", " ");
val = val.Replace("\n", " ");
Value.Text = val;

Save all the settings.

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.