How to put if condition on a specific word in input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to put if condition on a specific word in input

suppose in the text box I write "add 2 and 3" then the output should be the sum and if I write "subtract 2 from 3" then the output should be the subtraction. then how to put the condition on the words add and subtract ?

16th Mar 2017, 6:09 AM
parvesh khatri
parvesh khatri - avatar
2 Answers
+ 3
in which language? in PHP you can use strpos and check if it's return value is not false (!==).
16th Mar 2017, 6:49 AM
Mario L.
Mario L. - avatar
0
in c#
27th Mar 2017, 11:52 PM
parvesh khatri
parvesh khatri - avatar