6 kyu

Split Strings

55,468 of 167,516jhoffner

Description:

Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore ('_').

Examples:

* 'abc' =>  ['ab', 'c_']
* 'abcdef' => ['ab', 'cd', 'ef']
Regular Expressions
Strings
Algorithms

Stats:

CreatedApr 4, 2013
PublishedJul 25, 2013
Warriors Trained313764
Total Skips28080
Total Code Submissions467354
Total Times Completed167516
JavaScript Completions55468
Ruby Completions4662
CoffeeScript Completions225
PHP Completions6945
C# Completions9816
Python Completions57493
Haskell Completions1855
Elixir Completions585
Crystal Completions60
Go Completions4456
PowerShell Completions240
Scala Completions686
Julia Completions143
Clojure Completions308
C++ Completions8766
Java Completions16285
Prolog Completions31
Groovy Completions85
Rust Completions2097
COBOL Completions10
Factor Completions16
Swift Completions309
R Completions50
Dart Completions172
Kotlin Completions80
BF Completions4
Total Stars2216
% of votes with a positive feedback rating89% of 11929
Total "Very Satisfied" Votes9599
Total "Somewhat Satisfied" Votes2132
Total "Not Satisfied" Votes198
Ad
Contributors
  • jhoffner Avatar
  • stiell Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • candrabeqx Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • user5036852 Avatar
  • MartinPescatore Avatar
  • B1ts Avatar
  • davejones Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • Madjosz Avatar
  • kunicmarko20 Avatar
  • clcraig Avatar
  • monadius Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • Console Cowboy Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • gargamel Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • tri@ Avatar
  • AVElfallah Avatar
  • KayleighWasTaken Avatar
  • CClairvoyant Avatar
  • YurichBRO Avatar
  • saudiGuy Avatar
  • Smrtypants Avatar
Ad