Adding a editable note, formatting is removed and text is displayed as a run on sentance

Still new to mendix,  but where would I be looking, for when a user adds a text field to a profile, they have line breaks and when hitting save, it removes the line breaks and puts as a run on sentence.   Example: Line: data Line 2: Data data    Instead of displaying the note like the example it puts as "line: data Line 2: data"
1 answers

Hi Chris,


If I'm correct you want to remove the new lines? If so I would suggest the replaceAll() function.

To delete new line characters it would look something like this: replaceAll('$entitiy/string', '([\r?\n])', ' ')

It takes 3 arguments: the string to search in, RegEx to match with and the string to replace it with. The \r is to make it more flexible to match different types of line endings (such as Windows-style CRLF or Unix-style LF)