cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

instr

Former Member
0 Likes
237

Hi,

what value will be returned from the below, if the 2nd string is a part of the 1st one? and what value will be returned from the below, if the 2nd string is not a part of the 1st one?

instr({?Skill}, totext({vweShowAnswers.ANS_QId},0,"") )

Thanks & Best Regards

Edward

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

just going on from Abhilash

the result is the offset in the first string of the second string and 0 if it not in the first string.

put some sample data and simplify to instr(A$,B$)

abcdef def ( 4)

abcdef abc (1)

abcdef jjk (0 not found)

abcabc abc (1 the first )

instr("abcabc","abc",0) = 1

instr("abcabc","abc",2) = 4 ( this is not the second but starting from the second char)

abhilash_kumar
Active Contributor
0 Likes

Hi Edward,

Well, if the second string is a part of the first one then the formula will return 1 otherwise it will return 0.

For Eg:

Instr("SAPBO","SA") //Returns 1

Instr("SAPBO","SB") //Returns 0

Hope this helps!

-Abhilash