Trimming Carriage Returns From Text Fields

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))

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))
This was first published in November 2000

Dig deeper on Domino Resources - Part 7

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close