Guida di LibreOfficeDev 27.2
Restituisce il testo che precede l'inizio di una determinata istanza di una sottostringa delimitatrice.
TESTO.PRIMA( testo [; delimitatore [; numero istanza [; modo corrispondenza [; corrispondenza alla fine [; se non trovato ]]]]])
Testo: il testo originale.
Delimitatore: (opzionale) il delimitatore. Si possono specificare più delimitatori. Se omesso o specificato come stringa vuota, restituisce l'errore#N/D o il valore indicato da Se non trovato.
Numero di istanza: (opzionale) l'istanza del delimitatore prima del quale estrarre il testo. Il valore predefinito è 1. Un numero negativo avvia la ricerca dalla fine. Il valore 0 restituisce l'errore #N/D.
Modo corrispondenza: (facoltativo) impostarlo a 1 per trovare le corrispondenze senza distinzione tra maiuscole e minuscole. Il valore predefinito è 0.
Corrispondenza alla fine: (facoltativo) impostarlo a 1 per trattare la fine del testo come un delimitatore. Il valore predefinito è 0.
Se non trovato: (opzionale) il valore restituito se non viene trovata alcuna corrispondenza. Il valore predefinito è #N/D.
=TESTO.PRIMA("La Divina Commedia di Alighieri";"di";2;0;0;"@@@") restituisce la stringa "La Divina Commedia ", prendendo ciò che vi è prima della seconda occorrenza del delimitatore "di" (il primo è alla fine di Commedia).
=TESTO.PRIMA("Essere o non essere";"domanda";1;0;0;"@@@") restituisce il testo "@@@" perché il delimitatore "domanda" non è presente nel testo sorgente.
=TEXTBEFORE("To be or not to be";"question";1;0;1;"@@@") returns the text "To be or not to be" because the delimiter "question" is not in the source text and Match End is 1, which then returns everything before the end of text.
=TEXTBEFORE("To be or not to be";"question";-1;0;1;"@@@") returns the empty string "" because the delimiter "question" is not in the source text, Instance Number is negative (starts from the end) and Match End is 1, which prevents the function to return the error #N/A or the value defined in If Not Found.
COM.MICROSOFT.TEXTBEFORE