10 XP challenge
Check the Beginning of a Message
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return true if message begins with prefix, using case-sensitive matching. An empty prefix matches every message. message and prefix each contain 0 to 40 ASCII characters.
Examples
| Input | Return |
|---|---|
message = "coding", prefix = "cod" | true |
message = "coding", prefix = "con" | false |
Your code
Write your answer inside Solution, then use return to send it back.
Ln 1, Col 1
JavaScript
Try examples runs the public examples. Check my code checks your full answer and saves your completion.