1
\$\begingroup\$

This question already has an answer here:

Given two inputs, you should print or return whether the characters in the first string are - in order - inside the second string.

For example, we want to check whether the string hello, taken as the first input, and the sample text (the second input) is abhcedddldddloallllll.

This should output a truthy value, as the first input is in the second input. I will highlight it like this:

abhcedddldddloallllll

Examples:

hello
abhcedddldddoallllll

0 (not enough 'l's - the last few 'l's don't count because they're after the 'o')

hello
ahaecldleldo

1 (the multiple 'l's are fine)

foo
adasdasdsadasdasdasdasfsadasdasoddddddo

1

bar
aaabaaaarrrrra

1

bob
bob

1

You may, of course use other truthy or falsy values, and, of course, exclude text in brackets in your output.

You will only receive printable ASCII characters as input (that is, no whitespace or characters such as µ)

The shortest answer in bytes wins!

\$\endgroup\$

marked as duplicate by Martin Ender string Apr 5 '17 at 19:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ And the result of that example would be…? \$\endgroup\$ – manatwork Mar 13 '17 at 10:24
  • 3
    \$\begingroup\$ Welcome on PPCG. As it's currently written, the challenge is very unclear, and lack a victory criterion. I recommend you have a look at other challenges on this site to see how it's done usually, and then post your challenge in the Sandbox to get help from the community to improve it. \$\endgroup\$ – Dada Mar 13 '17 at 10:25
  • \$\begingroup\$ Not sure whether unclarity (sounds pretty clear he wants 'abcnjhgahgjhfhaljhrkhgrbhjbevfho'[/n.*a.*g.*a.*r.*r.*o/]) is the biggest issue. The challenge looks very familiar, just can't find its duplicate. \$\endgroup\$ – manatwork Mar 13 '17 at 10:29
  • 1
    \$\begingroup\$ I made some relatively major changes, feel free to edit if I did anything wrong. \$\endgroup\$ – Okx Mar 13 '17 at 11:04
  • 10
    \$\begingroup\$ Duplicate. \$\endgroup\$ – Martin Ender Mar 13 '17 at 11:19