A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Longest Word in Julia page! Here, you'll find the source code for this program as well as a description of how the program works.
function longest_word_length(text::String)
# Split on exactly the specified whitespace characters: space, tab, newline, carriage return
words = split(text, r"[ \t\n\r]+")
# Find the maximum length of the words array
return maximum(length.(words))
end
# Command-line argument handling
if length(ARGS) == 0 || strip(ARGS[1]) == ""
println("Usage: please provide a string")
exit(1)
end
input_string = ARGS[1]
println(longest_word_length(input_string))
Longest Word in Julia was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.