id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tmhscs@gmail.com strings > string_splitItUp
prev  |  next  |  chance

Given a String containing a sentence, break up the sentence and put each word into a String array. Use the method .split(" "), which returns a String[] where sending it a space indicates that you want to split up the String by spaces.


string_splitItUp("Hello students!") → ["Hello", "students!"]
string_splitItUp("Split up this String!") → ["Split", "up", "this", "String!"]
string_splitItUp("Use the split method!") → ["Use", "the", "split", "method!"]

...Save, Compile, Run (ctrl-enter)

public String[] string_splitItUp(String sentence) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy