Retired

String Breakers (retired)

1,239 of 2,519Capocaccia

Description:

I will give you an integer (N) and a string. Break the string up into as many substrings of N as you can without spaces. If there are leftover characters, include those as well.

Example: 

N = 5;

String = "This is an example string";

Return value:
Thisi
sanex
ample
strin
g

Return value as a string: 'Thisi'+'\n'+'sanex'+'\n'+'ample'+'\n'+'strin'+'\n'+'g'
Example: 

n = 5;

str = "This is an example string";

Return value:
Thisi
sanex
ample
strin
g

Return value as a string: "Thisi"+"\n"+"sanex"+"\n"+"ample"+"\n"+"strin"+"\n"+"g"
Example: 

n = 5;

st = "This is an example string";

Return value:
Thisi
sanex
ample
strin
g

Return value as a string: 'Thisi'+'\n'+'sanex'+'\n'+'ample'+'\n'+'strin'+'\n'+'g'
Example: 

n = 5;

st = "This is an example string";

return value:
Thisi
sanex
ample
strin
g

return value as a string: "Thisi"+"\n"+"sanex"+"\n"+"ample"+"\n"+"strin"+"\n"+"g"
Strings
Fundamentals

Stats:

CreatedOct 3, 2017
Warriors Trained3720
Total Skips60
Total Code Submissions11825
Total Times Completed2519
JavaScript Completions1239
C# Completions281
Python Completions1015
Ruby Completions58
Total Stars37
% of votes with a positive feedback rating93% of 474
Total "Very Satisfied" Votes417
Total "Somewhat Satisfied" Votes50
Total "Not Satisfied" Votes7
Total Rank Assessments16
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Capocaccia Avatar
  • Peter Rhodes Avatar
  • Souzooka Avatar
  • albertogcmr Avatar
  • ozichukwu Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • saudiGuy Avatar
Ad