Return the nth character of a string

More
2 months 2 weeks 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 Log in or Create an account to join the conversation.

LimeSurvey Partners
More
2 months 2 weeks 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 Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!