Ask coding questions

← Back to all posts
Help Please!
DanielStein5

Write a progra that validates a word typed in is not too exciting by checking for exclamation marks or hastags. If neither s present, then the sentence is good.
Ex:
Enter Word: B0o!
TOo exciting
Enter sentence: #Moo
Too Exciting
Enter sentence: Hello
Good

Voters
DanielStein5
Comments
hotnewtop
MattDESTROYER

You will need to be more specific about what language you are using. Many languages have an indexOf (or similarly named) method that can be used on strings to find the index of a string within a string (or if the string is not inside the string it usually returns -1, which is why this will be useful for you).

Some examples in different languages:

JavaScript:

Python:

C++:

C#:

And I could go on...