Skip to main content

popLastQuestion

Stentor API Reference


Stentor API Reference / stentor-utils/src / popLastQuestion

Function: popLastQuestion()

popLastQuestion(text): [string, string?]

Defined in: packages/stentor-utils/src/text.ts:95

Removes the last sentence from the text if it is a question.

Parameters​

text​

string

The input text from which the last question sentence will be removed.

Returns​

[string, string?]

Returns an array with the modified text in the first element and the last question sentence in the second element.
If there isn't a question in the text the first element will be unmodified and the second element will not be provided.