String variables are variables that hold zero or more text characters. This tutorial demonstrates their main properties by running simple examples on a test data file.
Working with string variables in SPSS is pretty straightforward if one masters some basic string functions. This tutorial will quickly walk you through the most important ones.
In this tutorial, we'll show a quick and simple way to extract leading digits from a string variable.
The SPSS INDEX function returns the position of the first occurrence of a given expression within a string. If this expression does not occur in the string, it returns a zero.
SPSS LTRIM removes leading spaces from string values. These occur especially when converting numbers to strings by using the string function.
SPSS REPLACE replaces a substring in a string by a different (possibly empty) substring.
SPSS Rtrim is sometimes needed for removing trailing spaces when concatenating strings. This tutorial shows some complications that may occur when it's omitted.