X645: Until Space

Write a function untilSpace(s) that returns a substring of s starting at the beginning and extending until a space is found. The space is not included in the returned value. The argument will always have a space.

Examples:

untilSpace("ab cde") -> "ab"

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.