NoSingleCharacters ( )

Function stats

Average user rating
223
236
9999
Support
FileMaker 7.0 +
Date posted
11 December 2009
Version
1
Recursive function
Yes

Author Info
 Ken S.

1 functions

Average Rating None

author_avatar



 

Function overview

Prototype

NoSingleCharacters  ( Text )


Parameters

Text  The text from which single letter words are to be removed


Description

Tags:  Text Parsing   Recursive   Custom Function  

This recursive function takes any text string and removes single alpha-numeric characters that are isolated by punctuation and spaces. In the process most punctuation is replaced with space characters. This can be useful when further parsing of the text would otherwise be complicated by single characters and punctuation.

Examples

Sample input

NoSingleCharacters(John_H_Smith@somewhere.net)


Sample output

John Smith somewhere net

 

Function code

Let (

[
FilterText = Substitute(Text;[".";" "];["-";" "];["_";" "];[",";" "];["@";" "];[";";" "];[":";" "]);
Iteration = WordCount(FilterText);
FirstWord = If(Length(LeftWords(FilterText;1))=1;"";LeftWords(FilterText;1) & " ");
RemainingList = RightWords (FilterText;Iteration-1)

];

FirstWord & Case(Iteration = 1 ;RemainingList;NoSingleCharacters(RemainingList) & " ")


)

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

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

    Prototype: NoSingleCharacters( Text )
    Function Author: Ken S. (http://www.fmfunctions.com/mid/223)
    Last updated: 11 December 2009
    Version: 1

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

 

 

 

 


Login or register to comment

Create a new account with fmcustomfunctions.com or login to post a comment.

 

 

 

Top Tags

Text Parsing  (31)
List  (20)
XML  (20)
Date  (19)
Format  (18)
Debug  (12)
Dev  (11)
Variables  (11)
Layout  (11)
Interface  (10)
Text  (10)
Filter  (10)
ValueIterator  (6)
Layout Objects  (6)
Uuid  (6)
HTML  (6)