Pagina 1 di 1

Una funzione per omettere

Inviato: martedì 3 dicembre 2013, 9:08
da raybaudi
Volevate omettere determinati caratteri da un testo ?
Tipo:
eliminare tutte le vocali Omit ( text ; "aeiouAEIOU" )
eliminare tutti i "ritorno a capo" Omit ( text ; ¶ )
eliminare alcuni simboli Omit ( text ; "^!.?," )
ecc.

Questa è la funzione che vi serve ed è rapidissima anche per lunghissimi testi !
Notare che l'eliminazione è "case sensitive", per cui potreste voler omettere tutte le "Z" e non le "z"

/*
Omit ( text ; string ) custom function

Author: Daniele Raybaudi

This custom function omits the chars of the string from the given text, without any practical limitation.

*/

Let(
$cfOmit = $cfOmit + 1;
Case (
$cfOmit ≤ Length ( string ) ; Omit ( Substitute ( text ; Middle ( string ; $cfOmit ; 1 ) ; "" ) ; string ) ;
Let( $cfOmit = "" ; text )
)
)