TEXTBEFORE

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

Синтаксис

TEXTBEFORE( Текст [; Разделител [; Номер на срещане [; Режим на съответствие [; Съответствие в края [; При ненамерен ]]]]])

Текст: оригиналният текст.

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

Режим на съответствие: (незадължителен) задайте 1 за търсене, нечувствително към регистъра. Подразбира се 0.

Съответствие в края: (незадължителен) задайте 1, за да се смята краят на текста за разделител. Подразбира се 0.

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

Икона Бележка

Всеки от незадължителните аргументи може да бъде пропуснат. Незадължителният аргумент изисква да присъстват всички предходни разделители.


Примери

=TEXTBEFORE("To be or not to be";" be";2;0;0;"@@@") returns the string "To be or not to", taking up to the second instance of the delimiter " be".

=TEXTBEFORE("Да бъдеш или да не бъдеш";"въпрос";1;0;0;"@@@") връща текста "@@@", защото разделителят "въпрос" не присъства в началния текст.

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

Техническа информация

Икона Съвет

This function is available since LibreOfficeDev 25.8.


Тази функция НЕ Е част от стандарта Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format. Пространството от имена е

COM.MICROSOFT.TEXTBEFORE

Моля, подкрепете ни!

Моля, подкрепете ни!