forked from petrowsky/fmpfunctions
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlist.trim.fmfn
More file actions
23 lines (17 loc) · 783 Bytes
/
list.trim.fmfn
File metadata and controls
23 lines (17 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
=====================================================
list.trim( values )
RETURNS: (list) trimmed version of the list
DEPENDENCIES:
VERSION: 1.0
AUTHOR: See notes
NOTES: Compliments http://www.briandunning.com/cf/904
=====================================================
*/
Let([
var.cleaned = Substitute( values; [ " "; "" ]; [ " "; "" ]; [ " "; "" ]; [ "¶"; "" ] ); // Text minus specified chars
var.char.first = Position( values; Left( var.cleaned; 1 ); 0; 1 ); // Position of firt non cleaned char
var.char.last = Position( values; Right( var.cleaned; 1 ); Length( values ); -1 ) // Position of last non cleaned char
];
Case( var.char.first; Middle( values; var.char.first; var.char.last - var.char.first + 1 ) )
)