caN it be acrOnymised?
Brachylog, 1 byte
⊇
Try it online!
Java 8, 46 39 38 35 bytes
a->b->a.matches(b.replace("",".*"))
-7 bytes thanks to @tsh.
-1 byte thanks to @NahuelFouilleul.
Try it online.
Explanation:
a->b-> // Method with two String parameters and boolean return-type
a.matches( // Check if the first input matches the regex:
b // The second input,
.replace("",".*"))
// where every character is surrounded with ".*"
For example:
a="HELLO WORLD"
b="LORD"
Will do the check:
"HELLO WORLD".matches("^.*L.*O.*R.*D.*$")
(The ^...$
will add the String#matches
builtin implicitly, since it will always try to match the entire String.)
C (gcc), 47 bytes
f(a,b)char*a,*b;{a=!*b||*a&&f(a+1,b+(*a==*b));}
Try it online!