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

 

jebbert@volusia.k12.fl.us > test2024_10_31_SLHL_stringFromChars
prev  |  next  |  chance

Write a method that has an input parameter called 'str'. The method returns an array of strings such that each element in the array is a string with a single character and the single character in the string at index 'i' in the array matches the character at position 'i' in the string 'str'. Look at the test data for examples.


test2024_10_31_SLHL_stringFromChars("A") → ["A"]
test2024_10_31_SLHL_stringFromChars("") → []
test2024_10_31_SLHL_stringFromChars("The Jedi Council has spoken.") → ["T", "h", "e", " ", "J", "e", "d", "i", " ", "C", "o", "u", "n", "c", "i", "l", " ", "h", "a", "s", " ", "s", "p", "o", "k", "e", "n", "."]

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

public String[] test2024_10_31_SLHL_stringFromChars(String str) { }

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

Difficulty: 240

Copyright Nick Parlante 2017 - privacy