6 kyu

Split Strings

55,463 of 167,504jhoffner

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 Trained313714
Total Skips28078
Total Code Submissions467323
Total Times Completed167504
JavaScript Completions55463
Ruby Completions4662
CoffeeScript Completions225
PHP Completions6945
C# Completions9815
Python Completions57490
Haskell Completions1855
Elixir Completions585
Crystal Completions60
Go Completions4454
PowerShell Completions240
Scala Completions686
Julia Completions143
Clojure Completions308
C++ Completions8765
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 11928
Total "Very Satisfied" Votes9599
Total "Somewhat Satisfied" Votes2131
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