Trim_CR ( )

Function stats

Average user rating
391
349
9999
Support
FileMaker 7.0 +
Date posted
25 February 2013
Last updated
25 February 2013
Version
Recursive function
Yes

Author Info
 menno

4 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

Trim_CR  ( Text )


Parameters

Text  A text with carriage-returns leading and/or trailing that must be removed


Description

Tags:  Text   Format  

All redundant leading and trailing returns will be removed, the returns between values will not be removed.

This function works for ¶ in exactly the same way as the Trim()-function does with leading and trailing spaces.

Examples

Sample input

Trim_CR ( "

This text will be cleansed from the ¶ at the beginning
and at the end. In the same way as the Trim() function
works for leading and trailing spaces.

Extra ¶ characters between the lines in the rest of the text
are not removed.

" )


Sample output

This text will be cleansed from the ¶ at the beginning
and at the end. In the same way as the Trim() function
works for leading and trailing spaces.

Extra ¶ characters between the lines in the rest of the text
are not removed.

 

Function code

// ####################
// ## Trim_CR function
// ##
// ## Author:
// ## Menno van Beek - STB Automatisering & Advies BV -
// ## Houten, the Netherlands
// ##
// ## Format:
// ## Trim_CR ( Text )
// ##
// ## Parameters:
// ## Text - Textstring with carriage-returns leading
// ## and/or trailing
// ##
// ## Data type returned:
// ## text
// ##
// ## Description:
// ## All redundant leading and trailing returns will be removed,
// ## the returns between values will not be removed
// ##
// ## July 31, 2012
// ####################

Case (
Left ( Text ; 1 ) = ¶ ; Trim_CR ( Right ( Text ; Length ( Text ) - 1 ) ) ;
Right ( Text ; 1 ) = ¶ ; Trim_CR ( Left ( Text ; Length ( Text ) - 1 ) ) ;
Text )

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/349

    Prototype: Trim_CR( Text )
    Function Author: menno (http://www.fmfunctions.com/mid/391)
    Last updated: 25 February 2013
    Version: 1.1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)