TEXTBEFORE

Returns the text that occurs before the start of given instance of a delimiter substring.

Syntaxe

TEXTBEFORE( Text [; Oddělovač [; Číslo instance [; Režim porovnávání [; Porovnávání konce [; Při nenalezení ]]]]])

Text: původní text.

Delimiter: (optional) the delimiter. Multiple delimiters can be supplied. If omitted or supplied as an empty string, then returns the error #N/A or the value expressed by If Not Found.

Instance Number: (optional) the instance of the delimiter before which to extract text. The default is 1. A negative number starts searching from the end. Value 0 returns the error #N/A

Režim porovnávání: (nepovinné) nastavte na 1, chcete-li při porovnávání ignorovat velikost písmen. Výchozí je 0.

Porovnávání konce: (nepovinné) nastavte na 1, chcete-li s koncem textu zacházet jako s oddělovačem. Výchozí je 0.

If Not Found: (optional) the value returned if no match is found. The default is #N/A.

Ikona poznámky

Jakýkoli z nepovinných argumentů lze vynechat. Nepovinný argument vyžaduje, aby byly přítomny všechny předchozí oddělovače.


Příklady

=TEXTBEFORE("Být, či nebýt";"být";2;0;0;"@@@") vrátí řetězec „Být, či ne“, odpovídající textu až po druhou instanci oddělovače „být“.

=TEXTBEFORE("Být, či nebýt";"otázka";1;0;0;"@@@") vrátí text „@@@“, protože oddělovač „otázka“ se ve zdrojovém textu nenachází.

=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.

Technické informace

Ikona tipu

This function is available since LibreOfficeDev 25.8.


Tato funkce NENÍ součástí standardu Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format. Její jmenný prostor je

COM.MICROSOFT.TEXTBEFORE

Podpořte nás!

Podpořte nás!