ChallengeToken concatenation and character replacement:
String Challenge
Have the function StringChallenge(sen) take the sen parameter being passed and return the longest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. Words may also contain numbers, for example "Hello world123 567"
Once your function is working, take the final output string and concatenate it with your ChallengeToken, and then replace every fourth character with an underscore.
Your ChallengeToken: 386emsol49
Examples
Input: "fun&!! time"
Output: time
Final Output: tim_386_mso_49
Input: "I love dogs"
Output: love
Final Output: lov_386_mso_49
--------------------------------
Java code to implement the StringChallenge
function as described, along with the ChallengeToken concatenation and character replacement:
Comments
Post a Comment