TEXTBEFORE

Returns the text that occurs before a given substring or delimiter.

Синтаксис

TEXTBEFORE( Text [; Delimiter [; Instance Number [; Match Mode [; Match End [; If Not Found ]]]]])

Text: the original text.

Delimiter: (optional) the delimiter. Multiple delimiters can be supplied.

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.

Match Mode: (optional) set to 1 to perform a case-insensitive match. The default is 0.

Match End: (optional) set to 1 to treat the end of text as a delimiter. The default is 0.

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

note

Необязательные аргументы можно пропустить. Дополнительный аргумент требует наличия всех предшествующих разделителей.


Примеры

=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("To be or not to be";"question";1;0;0;"@@@") returns the text "@@@" because the delimiter "question" is not in the source text.

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

tip

Эта функция доступна начиная с LibreOffice 25.8.


Эта функция НЕ входит в стандарт Формата Open Document для офисных приложений (OpenDocument) v1.3. Часть 4: Формат пересчитываемой формулы (OpenFormula). Используемое пространство имён:

COM.MICROSOFT.TEXTBEFORE

Пожалуйста, поддержите нас!