Return the nth character of a string

More
2 months 1 week ago #180069 by Glottis
Hi,

This is probably a simple one but I couldn't find anything in the documentation that mentions it.

How would you return a specific character from a string in an equation question? As an example; a survey respondent enters their name in the fields with the codes {firstname}{middlename}{lastname} and from these completed fields we want to return their initials (first letter in each name) in the equation field?

Many thanks in advance!

Please Identificarse or Create an account to join the conversation.

LimeSurvey Partners
More
2 months 1 week ago #180071 by Glottis
Nevermind! It's just regular old substr.

So for this example it would just be;

{substr(firstname,0)}{substr(Q00006,0)}{substr(Q00006,0)}
The following user(s) said Thank You: DenisChenu, LouisGac

Please Identificarse or Create an account to join the conversation.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión