String Functions

Top  Previous  Next

Lighthouse Studio includes a number of string functions for operations involving text variables (such as openends, etc.).  


The "Sawtooth Script" column below gives the syntax for String Functions.  


Sawtooth Script:


IsNumber (QuestionName)

Is true if the entire string is all digits, false otherwise.

More info

Length (QuestionName)

Returns the number of characters contained in the response.  

Mid (QuestionName, BeginPosition, Length)

Extracts a substring of a string given by QuestionName.  The substring is extracted starting at the character number specified in BeginPosition (1-based counting) with length specified in Length.

TextExists (QuestionName,


Searches for "TextToLookFor" in the answer of QuestionName.  If found, a 1 is returned; if not found, a 0 is returned.

ToLower (QuestionName)

Returns a lowercased version of the response.  

ToUpper (QuestionName)

Returns an uppercased version of the response.  


To concatenate strings, use the & operator.  For example:


 [% "Hello " & Name %]


If Name is an open-end question and the respondent answered "Bob" for Name, then the Sawtooth Script would return:


 Hello Bob




Page link: