TrimSpaceCR ( )

Function stats

Average user rating
224
237
9999
Support
FileMaker 7.0 +
Date posted
13 December 2009
Version
1
Recursive function
Yes

Author Info
 konrad

10 functions

Average Rating None

author_avatar



 

Function overview

Prototype

TrimSpaceCR  ( text )


Parameters

text  


Description

Tags:  Text Parsing  

remove any leading and trailing " " or "¶"
as an extension of FM function Trim(text)

Examples

Sample input

"
the text
"


Sample output

"the text"

 

Function code

//remove any leading and trailing " " or "¶"
//as an extension of Trim(text)

Let([

Text = Trim ( Text );
Text = If ( Left ( Text ; 1 ) = "¶" ; Right ( Text ; Length ( text ) - 1 ) ; Text );
Text = If ( Right ( Text ; 1 ) = "¶" ; Left ( Text ; Length ( text ) - 1 ) ; Text );
Text = Trim ( Text );

r = Right ( Text ; 1 ) = "¶" or Left ( Text ; 1 ) = "¶" ];


If ( r ; TrimSpaceCR (Text) ; Text ) //recursion!
)

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

    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/237

    Prototype: TrimSpaceCR( text )
    Function Author: konrad (http://www.fmfunctions.com/mid/224)
    Last updated: 13 December 2009
    Version: 1

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