Trimming Carriage Returns From Text Fields
carriage returns. This stopped working in Notes V3. Frequently, the developer
needs to ensure that short descriptive text phrases do not have these carriage
returns. The following input translation formula is a work-around for the old
version of @Trim.
Input Translation Formula for a field called Subject
@Trim(@If(@Contains(Subject; @Char(0)); @Left(Subject; @Char(0)) + " " +
@Right(Subject; @Char(0)); Subject))
Andre Guirard (Systems Consulting Group) notes,
In Notes V2, the @Trim function would eliminate all white space including
carriage returns. This stopped working in Notes V3. Frequently, the developer
needs to ensure that short descriptive text phrases do not have these carriage
returns. The following input translation formula is a work-around for the old
version of @Trim.
Input Translation Formula for a field called Subject
@Trim(@If(@Contains(Subject; @Char(0)); @Left(Subject; @Char(0))
+ " " + @Right(Subject; @Char(0)); Subject))
The problem is that this only works if the field contains no more than one
newline character. A better way is as follows:
@Trim(@ReplaceSubstring(Subject; @NewLine; " "))
Input Translation Formula for a field called Subject
@Trim(@If(@Contains(Subject; @Char(0)); @Left(Subject; @Char(0)) + " " +
@Right(Subject; @Char(0)); Subject))